org.apache.qpid.client.state
Class AMQStateManager
java.lang.Object
org.apache.qpid.client.state.AMQStateManager
- All Implemented Interfaces:
- AMQMethodListener
- Direct Known Subclasses:
- ClientHandlerRegistry
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
public AMQStateManager(AMQProtocolSession protocolSession)
AMQStateManager
protected AMQStateManager(AMQState state,
boolean register,
AMQProtocolSession protocolSession)
registerListeners
protected void registerListeners()
getCurrentState
public AMQState getCurrentState()
changeState
public void changeState(AMQState newState)
throws AMQException
- Throws:
AMQException
error
public void error(java.lang.Exception 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 AMQMethodBody> boolean methodReceived(AMQMethodEvent<B> evt)
throws 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 channel
- 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:
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 StateAwareMethodListener findStateTransitionHandler(AMQState currentState,
AMQMethodBody frame)
throws IllegalStateTransitionException
- Throws:
IllegalStateTransitionException
attainState
public void attainState(AMQState s)
throws AMQException
- Throws:
AMQException
getProtocolSession
public AMQProtocolSession getProtocolSession()
setProtocolSession
public void setProtocolSession(AMQProtocolSession session)
Copyright © 2007. All Rights Reserved.