|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.softamis.cluster4spring.support.provider.BaseEndpointProvider<E,SI> org.softamis.cluster4spring.support.provider.MultiURLEndpointProvider<E,SI> org.softamis.cluster4spring.support.provider.AbstractUrlListEndpointProvider<E,SI> org.softamis.cluster4spring.support.provider.AbstractDiscoveringEndpointProvider<E,SI> org.softamis.cluster4spring.support.provider.DiscoveringEndpointProvider<E,SI>
SI
- type of data used to invoke remote service (such as remote service URL)E
- type of endpoints that could be created by this factorypublic class DiscoveringEndpointProvider<E extends Endpoint<SI>,SI extends ServiceMoniker>
Implementation of EndpointProvider
that automatically discovers
services based on service name and service group. Such auto-discoverable
services are published via appropriate ServicePublisher
.
To discover urls for service, class relies on ConsumingRegistry
that handles details of networking communications.
ConsumingRegistry
Field Summary | |
---|---|
protected org.softamis.net.registry.ConsumingRegistry<java.lang.String,SI> |
fClientServicesRegistry
Registry of "urls" for service |
protected static org.apache.commons.logging.Log |
fLog
|
Fields inherited from class org.softamis.cluster4spring.support.provider.AbstractDiscoveringEndpointProvider |
---|
fProtocolName, fServiceGroup, fServiceKey, fServiceName |
Fields inherited from class org.softamis.cluster4spring.support.provider.AbstractUrlListEndpointProvider |
---|
fCacheLock, fEndpointsCache |
Fields inherited from class org.softamis.cluster4spring.support.provider.MultiURLEndpointProvider |
---|
fEndpointSelectionPolicy |
Fields inherited from class org.softamis.cluster4spring.support.provider.BaseEndpointProvider |
---|
fCacheEndpoints |
Constructor Summary | |
---|---|
protected |
DiscoveringEndpointProvider()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
Invoked by Spring as part of bean lifecycle. |
org.softamis.net.registry.ConsumingRegistry<java.lang.String,SI> |
getClientServicesRegistry()
Returns registry of "urls" for service |
protected void |
invalidateServiceInRegistry(java.lang.String aServiceKey,
SI aServiceInfo)
Methods used to notify underlying services registry that particular service location should be invalidated. |
protected boolean |
isRefreshRequiredForCachedEndpoints(java.lang.String aServiceKey)
Determines whether refresh for cached endpoints is required. |
protected java.util.Set<SI> |
obtainServiceUrlsFromRegistry(java.lang.String aServiceKey)
Returns set of service url's from consuming registry |
protected void |
saveFreshEndpointsToCache(java.util.List<E> aEndpoints)
Save obtained endpoints to endpoints cache. |
void |
setClientServicesRegistry(org.softamis.net.registry.ConsumingRegistry<java.lang.String,SI> aClientServicesRegistry)
Sets registry used to obtain information about of "urls" for service |
Methods inherited from class org.softamis.cluster4spring.support.provider.AbstractDiscoveringEndpointProvider |
---|
checkServiceName, createServiceKey, doRefreshServiceEndpointsList, getCachedEndpoints, getProtocolName, getServiceGroup, getServiceName, markInvalid, markServiceInvalidInternal, obtainServiceKey, onApplicationEvent, onContextClosed, onContextRefreshed, setProtocolName, setServiceGroup, setServiceName |
Methods inherited from class org.softamis.cluster4spring.support.provider.AbstractUrlListEndpointProvider |
---|
doGetCachedEndpoints, getServiceEndpointsList, refresh |
Methods inherited from class org.softamis.cluster4spring.support.provider.MultiURLEndpointProvider |
---|
createDefaultEndpointSelectionPolicy, getEndpoint, setEndpointSelectionPolicy |
Methods inherited from class org.softamis.cluster4spring.support.provider.BaseEndpointProvider |
---|
doCreateServiceEndpoint, isCacheEndpoints, setCacheEndpoints |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.commons.logging.Log fLog
protected org.softamis.net.registry.ConsumingRegistry<java.lang.String,SI extends ServiceMoniker> fClientServicesRegistry
Constructor Detail |
---|
protected DiscoveringEndpointProvider()
Method Detail |
---|
public void afterPropertiesSet() throws java.lang.Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
in class AbstractDiscoveringEndpointProvider<E extends Endpoint<SI>,SI extends ServiceMoniker>
java.lang.Exception
MultiURLEndpointProvider.createDefaultEndpointSelectionPolicy()
protected boolean isRefreshRequiredForCachedEndpoints(java.lang.String aServiceKey)
ConsumingRegistry
is dirty.
isRefreshRequiredForCachedEndpoints
in class AbstractDiscoveringEndpointProvider<E extends Endpoint<SI>,SI extends ServiceMoniker>
aServiceKey
- key used to check whether cahe should be refreshed
ConsumingRegistry.isDirty(Serializable)
protected void saveFreshEndpointsToCache(java.util.List<E> aEndpoints)
AbstractUrlListEndpointProvider
saveFreshEndpointsToCache
in class AbstractUrlListEndpointProvider<E extends Endpoint<SI>,SI extends ServiceMoniker>
aEndpoints
- list of endpoints to store in cacheprotected void invalidateServiceInRegistry(java.lang.String aServiceKey, SI aServiceInfo)
AbstractDiscoveringEndpointProvider
invalidateServiceInRegistry
in class AbstractDiscoveringEndpointProvider<E extends Endpoint<SI>,SI extends ServiceMoniker>
aServiceKey
- key used to obtain service urlsaServiceInfo
- information about particular service locationprotected java.util.Set<SI> obtainServiceUrlsFromRegistry(java.lang.String aServiceKey) throws java.lang.Exception
obtainServiceUrlsFromRegistry
in class AbstractDiscoveringEndpointProvider<E extends Endpoint<SI>,SI extends ServiceMoniker>
aServiceKey
- key used to obtain service urls
java.lang.Exception
public org.softamis.net.registry.ConsumingRegistry<java.lang.String,SI> getClientServicesRegistry()
public void setClientServicesRegistry(org.softamis.net.registry.ConsumingRegistry<java.lang.String,SI> aClientServicesRegistry)
aClientServicesRegistry
- registry of "urls" for service
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |