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

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

public class RedirectUponFailurePolicy
extends AbstractPolicy

This class defines the following load-balancing property: The protocols are returned in a round-robin way, but the currently used protocol only changes if a failure has been notified about it. However, no protocol is removed from the list of protocols, and failed protocols will eventually be returned again by nextProtocol.

Author:
Stefan Pleisch (SPL)
File-location:
RedirectUponFailurePolicy
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
RedirectUponFailurePolicy()
           
 
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

RedirectUponFailurePolicy

public RedirectUponFailurePolicy()
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.