org.softamis.cluster4spring.support.provider
Class BaseEndpointProvider<E extends Endpoint<SI>,SI extends ServiceMoniker>

java.lang.Object
  extended by org.softamis.cluster4spring.support.provider.BaseEndpointProvider<E,SI>
Type Parameters:
SI - type of data used to invoke remote service (such as remote service URL)
E - type of endpoints that could be created by this factory
All Implemented Interfaces:
EndpointProvider<E,SI>
Direct Known Subclasses:
MultiURLEndpointProvider, SingleUrlEndpointProvider

public abstract class BaseEndpointProvider<E extends Endpoint<SI>,SI extends ServiceMoniker>
extends java.lang.Object
implements EndpointProvider<E,SI>

Base abstract class to implement endpoint providers.

Author:
Andrew Sazonov
See Also:
Collections.shuffle(java.util.List)

Field Summary
protected  boolean fCacheEndpoints
          option which specifies that discovered endpoints should cached for later use
protected static org.apache.commons.logging.Log fLog
           
 
Constructor Summary
protected BaseEndpointProvider()
           
 
Method Summary
protected  E doCreateServiceEndpoint(org.springframework.remoting.support.RemoteInvocationFactory aRemoteInvocationFactory, EndpointFactory<E,SI> aEndpointFactory, java.lang.String aBeanName, SI aServiceInfo)
          Low level method for creation endpoints.
 boolean isCacheEndpoints()
          Returns option which specifies that discovered endpoints should cached for later use
 void setCacheEndpoints(boolean aCacheEndpoints)
          Sets option which specifies that discovered endpoints should cached for later use
 
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
getEndpoint, markInvalid, refresh
 

Field Detail

fLog

protected static final org.apache.commons.logging.Log fLog

fCacheEndpoints

protected boolean fCacheEndpoints
option which specifies that discovered endpoints should cached for later use

Constructor Detail

BaseEndpointProvider

protected BaseEndpointProvider()
Method Detail

doCreateServiceEndpoint

protected E doCreateServiceEndpoint(org.springframework.remoting.support.RemoteInvocationFactory aRemoteInvocationFactory,
                                    EndpointFactory<E,SI> aEndpointFactory,
                                    java.lang.String aBeanName,
                                    SI aServiceInfo)
                                                  throws org.springframework.remoting.RemoteAccessException
Low level method for creation endpoints. Delegates details of Endpoint creation to given EndpointFactory.

Parameters:
aRemoteInvocationFactory - factory used to create remote invocation
aEndpointFactory - factory used to create endpoints
aBeanName - name of servcice/bean
aServiceInfo - information about service
Returns:
created endpoint
Throws:
org.springframework.remoting.RemoteAccessException - thrown by endpoint factory if occured during creation endpoint

setCacheEndpoints

public void setCacheEndpoints(boolean aCacheEndpoints)
Sets option which specifies that discovered endpoints should cached for later use

Parameters:
aCacheEndpoints - true if endpoints should be cached

isCacheEndpoints

public boolean isCacheEndpoints()
Returns option which specifies that discovered endpoints should cached for later use

Returns:
true if endpoints should be cached