com.metamatrix.platform.service.proxy
Class RoundRobinSelectionPolicy

java.lang.Object
  extended by com.metamatrix.platform.service.proxy.RoundRobinSelectionPolicy
All Implemented Interfaces:
ServiceSelectionPolicy

public class RoundRobinSelectionPolicy
extends java.lang.Object
implements ServiceSelectionPolicy


Constructor Summary
RoundRobinSelectionPolicy(boolean preferLocal)
          ctor
 
Method Summary
 java.util.List getInstances()
          Get list of instances from the given service selection policy.
 ServiceRegistryBinding getNextInstance()
          Get the next service instance from the given service selection policy.
 void updateServices(java.util.List<ServiceRegistryBinding> localServices, java.util.List<ServiceRegistryBinding> remoteServices)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoundRobinSelectionPolicy

public RoundRobinSelectionPolicy(boolean preferLocal)
ctor

Method Detail

getNextInstance

public ServiceRegistryBinding getNextInstance()
                                       throws ServiceNotFoundException
Get the next service instance from the given service selection policy.

Specified by:
getNextInstance in interface ServiceSelectionPolicy
Returns:
The ServiceRegistryBinding for the next instance after being operated on by the selection policy.
Throws:
ServiceNotFoundException - if there are no services available.
ServiceNotFoundException - if the policy has no more services to hand out.
See Also:
com.metamatrix.common.service.ServiceInterface

getInstances

public java.util.List getInstances()
                            throws ServiceNotFoundException
Get list of instances from the given service selection policy.

Specified by:
getInstances in interface ServiceSelectionPolicy
Returns:
The List of ServiceRegistryBinding objects for the instances after being operated on by the selection policy.
Throws:
ServiceNotFoundException - if the policy has no more services to hand out.
See Also:
com.metamatrix.common.service.ServiceInterface

updateServices

public void updateServices(java.util.List<ServiceRegistryBinding> localServices,
                           java.util.List<ServiceRegistryBinding> remoteServices)
Specified by:
updateServices in interface ServiceSelectionPolicy


Copyright © 2009. All Rights Reserved.