org.apache.qpid.server.state
Class AMQStateManager
java.lang.Object
org.apache.qpid.server.state.AMQStateManager
- All Implemented Interfaces:
- AMQMethodListener
public class AMQStateManager
- extends java.lang.Object
- implements AMQMethodListener
The state manager is responsible for managing the state of the protocol session.
For each AMQProtocolHandler there is a separate state manager.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AMQStateManager
public AMQStateManager()
AMQStateManager
protected AMQStateManager(AMQState initial,
boolean register)
registerListeners
protected void registerListeners()
getCurrentState
public AMQState getCurrentState()
changeState
public void changeState(AMQState newState)
throws org.apache.qpid.AMQException
- Throws:
org.apache.qpid.AMQException
error
public void error(org.apache.qpid.AMQException e)
- Description copied from interface:
AMQMethodListener
- Callback when an error has occurred. Allows listeners to clean up.
- Specified by:
error
in interface AMQMethodListener
methodReceived
public <B extends org.apache.qpid.framing.AMQMethodBody> boolean methodReceived(AMQMethodEvent<B> evt,
AMQProtocolSession protocolSession,
QueueRegistry queueRegistry,
ExchangeRegistry exchangeRegistry)
throws org.apache.qpid.AMQException
- Description copied from interface:
AMQMethodListener
- Invoked when a method frame has been received
- Specified by:
methodReceived
in interface AMQMethodListener
- Parameters:
evt
- the event that contains the method and channelprotocolSession
- the protocol session associated with the event
- Returns:
- true if the handler has processed the method frame, false otherwise. Note
that this does not prohibit the method event being delivered to subsequent listeners
but can be used to determine if nobody has dealt with an incoming method frame.
- Throws:
org.apache.qpid.AMQException
- if an error has occurred. This exception will be delivered
to all registered listeners using the error() method (see below) allowing them to
perform cleanup if necessary.
findStateTransitionHandler
protected <B extends org.apache.qpid.framing.AMQMethodBody> StateAwareMethodListener<B> findStateTransitionHandler(AMQState currentState,
B frame)
throws IllegalStateTransitionException
- Throws:
IllegalStateTransitionException
addStateListener
public void addStateListener(StateListener listener)
removeStateListener
public void removeStateListener(StateListener listener)