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