|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.qpid.client.state.AMQStateManager
public class AMQStateManager
The state manager is responsible for managing the state of the protocol session.
For eachAMQProtocolHandler
there is a separate state manager.
The AMQStateManager is now attached to the AMQProtocolHandler
and that is the sole point of reference so that
As the AMQProtocolSession
changes due to failover the AMQStateManager need not be copied around.
The StateManager works by any component can wait for a state change to occur by using the following sequence.
Field Summary | |
---|---|
protected List<StateWaiter> |
_waiters
|
Constructor Summary | |
---|---|
|
AMQStateManager()
|
|
AMQStateManager(AMQProtocolSession protocolSession)
|
protected |
AMQStateManager(AMQState state,
AMQProtocolSession protocolSession)
|
Method Summary | ||
---|---|---|
void |
changeState(AMQState newState)
|
|
void |
clearLastException()
|
|
StateWaiter |
createWaiter(Set<AMQState> states)
Create and add a new waiter to the notifcation list. |
|
void |
error(Exception error)
Propogate error to waiters |
|
AMQState |
getCurrentState()
|
|
Exception |
getLastException()
|
|
long |
getWaitTimeout()
This provides a single place that the maximum time for state change to occur can be accessed. |
|
|
methodReceived(org.apache.qpid.protocol.AMQMethodEvent<B> evt)
|
|
void |
removeWaiter(StateWaiter waiter)
Remove the waiter from the notification list. |
|
void |
setProtocolSession(AMQProtocolSession session)
Setting of the ProtocolSession will be required when Failover has been successfuly compeleted. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final List<StateWaiter> _waiters
Constructor Detail |
---|
public AMQStateManager()
public AMQStateManager(AMQProtocolSession protocolSession)
protected AMQStateManager(AMQState state, AMQProtocolSession protocolSession)
Method Detail |
---|
public AMQState getCurrentState()
public void changeState(AMQState newState)
public <B extends org.apache.qpid.framing.AMQMethodBody> boolean methodReceived(org.apache.qpid.protocol.AMQMethodEvent<B> evt) throws org.apache.qpid.AMQException
methodReceived
in interface org.apache.qpid.protocol.AMQMethodListener
org.apache.qpid.AMQException
public void setProtocolSession(AMQProtocolSession session)
AMQProtocolSession
that has been re-established needs to be provided as that is now the
connection to the network.
session
- The new protocol sessionpublic void error(Exception error)
error
in interface org.apache.qpid.protocol.AMQMethodListener
error
- The error to propogate.public long getWaitTimeout()
public StateWaiter createWaiter(Set<AMQState> states)
states
- The waiter will attempt to wait for one of these desired set states to be achived.
public void removeWaiter(StateWaiter waiter)
waiter
- The waiter to remove.public Exception getLastException()
public void clearLastException()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |