org.softamis.cluster4spring.support
Interface EndpointSelectionPolicy<E extends Endpoint<SI>,SI extends ServiceMoniker>

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 Known Implementing Classes:
DefaultEndpointSelectionPolicy, LastAccessTimeEndpointSelectionPolicy, ShuffleEndpointSelectionPolicy

public interface EndpointSelectionPolicy<E extends Endpoint<SI>,SI extends ServiceMoniker>

Policy that performs selection of endpoint for invocation from the given list of available endpoints. Various policies could be implemented to satisfy needs of particular application - selecting first valid endpoint, selecting endpoints based on the last access time, selecting endpoints randomly and so on.

Author:
Andrew Sazonov

Method Summary
 E selectServiceEndpoint(java.util.List<E> aEndpoints)
          Selects endpoint for invocation from the given list of endpoints.
 

Method Detail

selectServiceEndpoint

E selectServiceEndpoint(java.util.List<E> aEndpoints)
                                             throws org.springframework.remoting.RemoteAccessException
Selects endpoint for invocation from the given list of endpoints. The logic which is used to select particular endpoint if incapsulated in particular implementation of this method.

Parameters:
aEndpoints - list of endpoints available for invocation of remote service
Returns:
selected endpoints
Throws:
org.springframework.remoting.RemoteAccessException - throw if some error occured during seleting endpoint for invocation