|
|||||||||
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>
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 abstract class AbstractUrlListEndpointProvider<E extends Endpoint<SI>,SI extends ServiceMoniker>
Base abstract class to implement endpoint providers which provide endpoints based on list of endpoints available for service and which maintains internal cache of discovered endpoints.
Field Summary | |
---|---|
protected java.lang.Object |
fCacheLock
Object used as lock to access cache of endpoints |
protected java.util.List<E> |
fEndpointsCache
List which contains discovered endpoints |
protected static org.apache.commons.logging.Log |
fLog
|
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 |
AbstractUrlListEndpointProvider()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
Invoked by Spring as part of bean lifecycle. |
protected java.util.List<E> |
doGetCachedEndpoints()
Utility method to obtain list of enpoints from cache. |
protected abstract java.util.List<E> |
doRefreshServiceEndpointsList(org.springframework.remoting.support.RemoteInvocationFactory aRemoteInvocationFactory,
EndpointFactory<E,SI> aEndpointFactory,
java.lang.String aBeanName)
Creates list of endpoints available for service. |
protected java.util.List<E> |
getCachedEndpoints(org.springframework.remoting.support.RemoteInvocationFactory aRemoteInvocationFactory,
EndpointFactory<E,SI> aEndpointFactory,
java.lang.String aBeanName)
Obtains endpoints from endpoints cache. |
protected java.util.List<E> |
getServiceEndpointsList(org.springframework.remoting.support.RemoteInvocationFactory aRemoteInvocationFactory,
EndpointFactory<E,SI> aEndpointFactory,
java.lang.String aBeanName)
Performs actual obtaining of list of available endpoints. |
void |
refresh(org.springframework.remoting.support.RemoteInvocationFactory aRemoteInvocationFactory,
EndpointFactory<E,SI> aEndpointFactory,
java.lang.String aBeanName)
Refreshes internal state of provider. |
protected void |
saveFreshEndpointsToCache(java.util.List<E> aEndpoints)
Save obtained endpoints to endpoints cache. |
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 |
Methods inherited from interface org.softamis.cluster4spring.support.EndpointProvider |
---|
markInvalid |
Field Detail |
---|
protected static final org.apache.commons.logging.Log fLog
protected java.util.List<E extends Endpoint<SI>> fEndpointsCache
protected final java.lang.Object fCacheLock
Constructor Detail |
---|
protected AbstractUrlListEndpointProvider()
Method Detail |
---|
public void afterPropertiesSet() throws java.lang.Exception
MultiURLEndpointProvider
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
in class MultiURLEndpointProvider<E extends Endpoint<SI>,SI extends ServiceMoniker>
java.lang.Exception
MultiURLEndpointProvider.createDefaultEndpointSelectionPolicy()
public void refresh(org.springframework.remoting.support.RemoteInvocationFactory aRemoteInvocationFactory, EndpointFactory<E,SI> aEndpointFactory, java.lang.String aBeanName) throws org.springframework.remoting.RemoteAccessException
aRemoteInvocationFactory
- factory used to create remote invocationaEndpointFactory
- factory used to create endpointsaBeanName
- name of bean that is used as proxy for remote service
org.springframework.remoting.RemoteAccessException
- throw if exception occured during refreshingprotected java.util.List<E> getServiceEndpointsList(org.springframework.remoting.support.RemoteInvocationFactory aRemoteInvocationFactory, EndpointFactory<E,SI> aEndpointFactory, java.lang.String aBeanName) throws org.springframework.remoting.RemoteAccessException
getServiceEndpointsList
in class MultiURLEndpointProvider<E extends Endpoint<SI>,SI extends ServiceMoniker>
aRemoteInvocationFactory
- factory used for remote invocationaEndpointFactory
- factory used for endpoints creationaBeanName
-
org.springframework.remoting.RemoteAccessException
BaseEndpointProvider.setCacheEndpoints(boolean)
protected java.util.List<E> getCachedEndpoints(org.springframework.remoting.support.RemoteInvocationFactory aRemoteInvocationFactory, EndpointFactory<E,SI> aEndpointFactory, java.lang.String aBeanName)
aRemoteInvocationFactory
- factory to create remote invocationsaEndpointFactory
- factory used to create endpointsaBeanName
-
protected java.util.List<E> doGetCachedEndpoints()
protected void saveFreshEndpointsToCache(java.util.List<E> aEndpoints)
aEndpoints
- list of endpoints to store in cacheprotected abstract java.util.List<E> doRefreshServiceEndpointsList(org.springframework.remoting.support.RemoteInvocationFactory aRemoteInvocationFactory, EndpointFactory<E,SI> aEndpointFactory, java.lang.String aBeanName) throws org.springframework.remoting.RemoteAccessException
aRemoteInvocationFactory
- factory used to create remote invocationaEndpointFactory
- factory used to create endpointsaBeanName
-
org.springframework.remoting.RemoteAccessException
- throws if list of endpoints could not be created
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |