ch.elca.el4j.services.remoting.protocol.loadbalancing.policy
Class RandomPolicy

java.lang.Object
  extended by ch.elca.el4j.services.remoting.protocol.loadbalancing.policy.AbstractPolicy
      extended by ch.elca.el4j.services.remoting.protocol.loadbalancing.policy.RandomPolicy

public class RandomPolicy
extends AbstractPolicy

Chooses the protocol according to a random policy. Protocols for whom a failure has been notified, are removed.

Author:
Stefan Pleisch (SPL)
File-location:
RandomPolicy
Last check-in date:
2009-08-04 15:35:01 +0200 (Di, 04. Aug 2009) by swismer for revision 3883

Field Summary
 
Fields inherited from class ch.elca.el4j.services.remoting.protocol.loadbalancing.policy.AbstractPolicy
m_protocols
 
Constructor Summary
RandomPolicy()
           
 
Method Summary
 AbstractRemotingProtocol getNextProtocol()
          Note that protocol comparison must be done using "=="!
 void notifyFailure(AbstractRemotingProtocol protocol)
          This method is called if the use of one of the protocols has failed.
 
Methods inherited from class ch.elca.el4j.services.remoting.protocol.loadbalancing.policy.AbstractPolicy
getProtocolCount, removeProtocol, setProtocols
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomPolicy

public RandomPolicy()
Method Detail

getNextProtocol

public AbstractRemotingProtocol getNextProtocol()
                                         throws NoProtocolAvailableRTException
Note that protocol comparison must be done using "=="!

Specified by:
getNextProtocol in class AbstractPolicy
Returns:
The next protocol to be used.
Throws:
NoProtocolAvailableRTException - If no protocol is available any more

notifyFailure

public void notifyFailure(AbstractRemotingProtocol protocol)
This method is called if the use of one of the protocols has failed. Protocol comparison must be done using "=="!

Overrides:
notifyFailure in class AbstractPolicy
Parameters:
protocol - The protocol that has lead to a failure.


Copyright © 2005-2011 ELCA. All Rights Reserved.