@Provider public class IntegerDiscoveryContext extends java.lang.Object implements DiscoveryContext<java.lang.Integer>, javax.ws.rs.ext.ContextResolver<DiscoveryContext<java.lang.Integer>>
DiscoveryContext
that uses an int as the
payloadConstructor and Description |
---|
IntegerDiscoveryContext(ServiceDiscovery<java.lang.Integer> serviceDiscovery,
ProviderStrategy<java.lang.Integer> providerStrategy,
int instanceRefreshMs) |
Modifier and Type | Method and Description |
---|---|
DiscoveryContext<java.lang.Integer> |
getContext(java.lang.Class<?> type) |
int |
getInstanceRefreshMs()
Return the threshold in milliseconds to consider a registration stale
|
ProviderStrategy<java.lang.Integer> |
getProviderStrategy()
Return the provider strategy to use for
DiscoveryResource.getAny(String) |
ServiceDiscovery<java.lang.Integer> |
getServiceDiscovery()
Return the service singleton
|
void |
marshallJson(org.codehaus.jackson.node.ObjectNode node,
java.lang.String fieldName,
java.lang.Integer payload)
Serialize your payload
|
java.lang.Integer |
unMarshallJson(org.codehaus.jackson.JsonNode node)
Deserialize your payload
|
public IntegerDiscoveryContext(ServiceDiscovery<java.lang.Integer> serviceDiscovery, ProviderStrategy<java.lang.Integer> providerStrategy, int instanceRefreshMs)
public ProviderStrategy<java.lang.Integer> getProviderStrategy()
DiscoveryContext
DiscoveryResource.getAny(String)
getProviderStrategy
in interface DiscoveryContext<java.lang.Integer>
public int getInstanceRefreshMs()
DiscoveryContext
getInstanceRefreshMs
in interface DiscoveryContext<java.lang.Integer>
public ServiceDiscovery<java.lang.Integer> getServiceDiscovery()
DiscoveryContext
getServiceDiscovery
in interface DiscoveryContext<java.lang.Integer>
public void marshallJson(org.codehaus.jackson.node.ObjectNode node, java.lang.String fieldName, java.lang.Integer payload) throws java.lang.Exception
DiscoveryContext
marshallJson
in interface DiscoveryContext<java.lang.Integer>
node
- the node to serialize intofieldName
- field name to usepayload
- the payload value (can be null)java.lang.Exception
- any errorspublic java.lang.Integer unMarshallJson(org.codehaus.jackson.JsonNode node) throws java.lang.Exception
DiscoveryContext
unMarshallJson
in interface DiscoveryContext<java.lang.Integer>
node
- the node that has the payloadjava.lang.Exception
- any errorspublic DiscoveryContext<java.lang.Integer> getContext(java.lang.Class<?> type)
getContext
in interface javax.ws.rs.ext.ContextResolver<DiscoveryContext<java.lang.Integer>>