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