org.apache.qpid.jms.failover
Class FailoverSingleServer

java.lang.Object
  extended by org.apache.qpid.jms.failover.FailoverSingleServer
All Implemented Interfaces:
FailoverMethod
Direct Known Subclasses:
NoFailover

public class FailoverSingleServer
extends Object
implements FailoverMethod


Field Summary
protected  int _currentRetries
          The current number of attempts made to the server
protected  int _retries
          The number of times to retry connecting to the sever
static int DEFAULT_SERVER_RETRIES
          The default number of times to rety a conection to this server
 
Fields inherited from interface org.apache.qpid.jms.failover.FailoverMethod
FAILOVER_EXCHANGE, NO_FAILOVER, RANDOM, ROUND_ROBIN, SINGLE_BROKER
 
Constructor Summary
FailoverSingleServer(BrokerDetails brokerDetail)
           
FailoverSingleServer(ConnectionURL connectionDetails)
           
 
Method Summary
 void attainedConnection()
          Notification to the Failover method that a connection has been attained.
 boolean failoverAllowed()
          Check if failover is possible for this method
 BrokerDetails getCurrentBrokerDetails()
          If there is no current BrokerDetails the null will be returned.
 BrokerDetails getNextBrokerDetails()
          Move to the next BrokerDetails if one is available.
 String methodName()
           
 void reset()
          Reset the Failover to initial conditions
 void setBroker(BrokerDetails broker)
          Set the currently active broker to be the new value.
 void setRetries(int retries)
          Set the retries for this method
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_SERVER_RETRIES

public static final int DEFAULT_SERVER_RETRIES
The default number of times to rety a conection to this server

See Also:
Constant Field Values

_retries

protected int _retries
The number of times to retry connecting to the sever


_currentRetries

protected int _currentRetries
The current number of attempts made to the server

Constructor Detail

FailoverSingleServer

public FailoverSingleServer(ConnectionURL connectionDetails)

FailoverSingleServer

public FailoverSingleServer(BrokerDetails brokerDetail)
Method Detail

reset

public void reset()
Description copied from interface: FailoverMethod
Reset the Failover to initial conditions

Specified by:
reset in interface FailoverMethod

failoverAllowed

public boolean failoverAllowed()
Description copied from interface: FailoverMethod
Check if failover is possible for this method

Specified by:
failoverAllowed in interface FailoverMethod
Returns:
true if failover is allowed

attainedConnection

public void attainedConnection()
Description copied from interface: FailoverMethod
Notification to the Failover method that a connection has been attained.

Specified by:
attainedConnection in interface FailoverMethod

getCurrentBrokerDetails

public BrokerDetails getCurrentBrokerDetails()
Description copied from interface: FailoverMethod
If there is no current BrokerDetails the null will be returned.

Specified by:
getCurrentBrokerDetails in interface FailoverMethod
Returns:
The current BrokerDetail value to use

getNextBrokerDetails

public BrokerDetails getNextBrokerDetails()
Description copied from interface: FailoverMethod
Move to the next BrokerDetails if one is available.

Specified by:
getNextBrokerDetails in interface FailoverMethod
Returns:
the next BrokerDetail or null if there is none.

setBroker

public void setBroker(BrokerDetails broker)
Description copied from interface: FailoverMethod
Set the currently active broker to be the new value.

Specified by:
setBroker in interface FailoverMethod
Parameters:
broker - The new BrokerDetail value

setRetries

public void setRetries(int retries)
Description copied from interface: FailoverMethod
Set the retries for this method

Specified by:
setRetries in interface FailoverMethod
Parameters:
retries - the maximum number of time to retry this Method

methodName

public String methodName()
Specified by:
methodName in interface FailoverMethod
Returns:
The name of this method for display purposes.

toString

public String toString()
Overrides:
toString in class Object


Licensed to the Apache Software Foundation