org.apache.activemq.state
Class ConnectionStateTracker

java.lang.Object
  extended by org.apache.activemq.state.CommandVisitorAdapter
      extended by org.apache.activemq.state.ConnectionStateTracker
All Implemented Interfaces:
CommandVisitor

public class ConnectionStateTracker
extends CommandVisitorAdapter

Tracks the state of a connection so a newly established transport can be re-initialized to the state that was tracked.


Field Summary
protected  ConcurrentHashMap<ConnectionId,ConnectionState> connectionStates
           
 
Constructor Summary
ConnectionStateTracker()
           
 
Method Summary
 void connectionInterruptProcessingComplete(Transport transport, ConnectionId connectionId)
           
 int getMaxCacheSize()
           
 boolean isRestoreConsumers()
           
 boolean isRestoreProducers()
           
 boolean isRestoreSessions()
           
 boolean isRestoreTransaction()
           
 boolean isTrackMessages()
           
 boolean isTrackTransactionProducers()
           
 boolean isTrackTransactions()
           
 Response processAddConnection(ConnectionInfo info)
           
 Response processAddConsumer(ConsumerInfo info)
           
 Response processAddDestination(DestinationInfo info)
           
 Response processAddProducer(ProducerInfo info)
           
 Response processAddSession(SessionInfo info)
           
 Response processBeginTransaction(TransactionInfo info)
           
 Response processCommitTransactionOnePhase(TransactionInfo info)
           
 Response processCommitTransactionTwoPhase(TransactionInfo info)
           
 Response processEndTransaction(TransactionInfo info)
           
 Response processMessage(Message send)
           
 Response processMessagePull(MessagePull pull)
           
 Response processPrepareTransaction(TransactionInfo info)
           
 Response processRemoveConnection(ConnectionId id, long lastDeliveredSequenceId)
           
 Response processRemoveConsumer(ConsumerId id, long lastDeliveredSequenceId)
           
 Response processRemoveDestination(DestinationInfo info)
           
 Response processRemoveProducer(ProducerId id)
           
 Response processRemoveSession(SessionId id, long lastDeliveredSequenceId)
           
 Response processRollbackTransaction(TransactionInfo info)
           
 void restore(Transport transport)
           
protected  void restoreConsumers(Transport transport, SessionState sessionState)
           
protected  void restoreProducers(Transport transport, SessionState sessionState)
           
protected  void restoreSessions(Transport transport, ConnectionState connectionState)
           
protected  void restoreTempDestinations(Transport transport, ConnectionState connectionState)
           
 void setMaxCacheSize(int maxCacheSize)
           
 void setRestoreConsumers(boolean restoreConsumers)
           
 void setRestoreProducers(boolean restoreProducers)
           
 void setRestoreSessions(boolean restoreSessions)
           
 void setRestoreTransaction(boolean restoreTransaction)
           
 void setTrackMessages(boolean trackMessages)
           
 void setTrackTransactionProducers(boolean trackTransactionProducers)
           
 void setTrackTransactions(boolean trackTransactions)
           
 Tracked track(Command command)
           
 void trackBack(Command command)
           
 void transportInterrupted(ConnectionId connectionId)
           
 
Methods inherited from class org.apache.activemq.state.CommandVisitorAdapter
processBrokerInfo, processConnectionControl, processConnectionError, processConsumerControl, processControlCommand, processFlush, processForgetTransaction, processKeepAlive, processMessageAck, processMessageDispatch, processMessageDispatchNotification, processProducerAck, processRecoverTransactions, processRemoveSubscription, processShutdown, processWireFormat
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connectionStates

protected final ConcurrentHashMap<ConnectionId,ConnectionState> connectionStates
Constructor Detail

ConnectionStateTracker

public ConnectionStateTracker()
Method Detail

track

public Tracked track(Command command)
              throws IOException
Parameters:
command -
Returns:
null if the command is not state tracked.
Throws:
IOException

trackBack

public void trackBack(Command command)

restore

public void restore(Transport transport)
             throws IOException
Throws:
IOException

restoreSessions

protected void restoreSessions(Transport transport,
                               ConnectionState connectionState)
                        throws IOException
Parameters:
transport -
connectionState -
Throws:
IOException

restoreConsumers

protected void restoreConsumers(Transport transport,
                                SessionState sessionState)
                         throws IOException
Parameters:
transport -
sessionState -
Throws:
IOException

restoreProducers

protected void restoreProducers(Transport transport,
                                SessionState sessionState)
                         throws IOException
Parameters:
transport -
sessionState -
Throws:
IOException

restoreTempDestinations

protected void restoreTempDestinations(Transport transport,
                                       ConnectionState connectionState)
                                throws IOException
Parameters:
transport -
connectionState -
Throws:
IOException

processAddDestination

public Response processAddDestination(DestinationInfo info)
Specified by:
processAddDestination in interface CommandVisitor
Overrides:
processAddDestination in class CommandVisitorAdapter

processRemoveDestination

public Response processRemoveDestination(DestinationInfo info)
Specified by:
processRemoveDestination in interface CommandVisitor
Overrides:
processRemoveDestination in class CommandVisitorAdapter

processAddProducer

public Response processAddProducer(ProducerInfo info)
Specified by:
processAddProducer in interface CommandVisitor
Overrides:
processAddProducer in class CommandVisitorAdapter

processRemoveProducer

public Response processRemoveProducer(ProducerId id)
Specified by:
processRemoveProducer in interface CommandVisitor
Overrides:
processRemoveProducer in class CommandVisitorAdapter

processAddConsumer

public Response processAddConsumer(ConsumerInfo info)
Specified by:
processAddConsumer in interface CommandVisitor
Overrides:
processAddConsumer in class CommandVisitorAdapter

processRemoveConsumer

public Response processRemoveConsumer(ConsumerId id,
                                      long lastDeliveredSequenceId)
Specified by:
processRemoveConsumer in interface CommandVisitor
Overrides:
processRemoveConsumer in class CommandVisitorAdapter

processAddSession

public Response processAddSession(SessionInfo info)
Specified by:
processAddSession in interface CommandVisitor
Overrides:
processAddSession in class CommandVisitorAdapter

processRemoveSession

public Response processRemoveSession(SessionId id,
                                     long lastDeliveredSequenceId)
Specified by:
processRemoveSession in interface CommandVisitor
Overrides:
processRemoveSession in class CommandVisitorAdapter

processAddConnection

public Response processAddConnection(ConnectionInfo info)
Specified by:
processAddConnection in interface CommandVisitor
Overrides:
processAddConnection in class CommandVisitorAdapter

processRemoveConnection

public Response processRemoveConnection(ConnectionId id,
                                        long lastDeliveredSequenceId)
                                 throws Exception
Specified by:
processRemoveConnection in interface CommandVisitor
Overrides:
processRemoveConnection in class CommandVisitorAdapter
Throws:
Exception

processMessage

public Response processMessage(Message send)
                        throws Exception
Specified by:
processMessage in interface CommandVisitor
Overrides:
processMessage in class CommandVisitorAdapter
Throws:
Exception

processBeginTransaction

public Response processBeginTransaction(TransactionInfo info)
Specified by:
processBeginTransaction in interface CommandVisitor
Overrides:
processBeginTransaction in class CommandVisitorAdapter

processPrepareTransaction

public Response processPrepareTransaction(TransactionInfo info)
                                   throws Exception
Specified by:
processPrepareTransaction in interface CommandVisitor
Overrides:
processPrepareTransaction in class CommandVisitorAdapter
Throws:
Exception

processCommitTransactionOnePhase

public Response processCommitTransactionOnePhase(TransactionInfo info)
                                          throws Exception
Specified by:
processCommitTransactionOnePhase in interface CommandVisitor
Overrides:
processCommitTransactionOnePhase in class CommandVisitorAdapter
Throws:
Exception

processCommitTransactionTwoPhase

public Response processCommitTransactionTwoPhase(TransactionInfo info)
                                          throws Exception
Specified by:
processCommitTransactionTwoPhase in interface CommandVisitor
Overrides:
processCommitTransactionTwoPhase in class CommandVisitorAdapter
Throws:
Exception

processRollbackTransaction

public Response processRollbackTransaction(TransactionInfo info)
                                    throws Exception
Specified by:
processRollbackTransaction in interface CommandVisitor
Overrides:
processRollbackTransaction in class CommandVisitorAdapter
Throws:
Exception

processEndTransaction

public Response processEndTransaction(TransactionInfo info)
                               throws Exception
Specified by:
processEndTransaction in interface CommandVisitor
Overrides:
processEndTransaction in class CommandVisitorAdapter
Throws:
Exception

processMessagePull

public Response processMessagePull(MessagePull pull)
                            throws Exception
Specified by:
processMessagePull in interface CommandVisitor
Overrides:
processMessagePull in class CommandVisitorAdapter
Throws:
Exception

isRestoreConsumers

public boolean isRestoreConsumers()

setRestoreConsumers

public void setRestoreConsumers(boolean restoreConsumers)

isRestoreProducers

public boolean isRestoreProducers()

setRestoreProducers

public void setRestoreProducers(boolean restoreProducers)

isRestoreSessions

public boolean isRestoreSessions()

setRestoreSessions

public void setRestoreSessions(boolean restoreSessions)

isTrackTransactions

public boolean isTrackTransactions()

setTrackTransactions

public void setTrackTransactions(boolean trackTransactions)

isTrackTransactionProducers

public boolean isTrackTransactionProducers()

setTrackTransactionProducers

public void setTrackTransactionProducers(boolean trackTransactionProducers)

isRestoreTransaction

public boolean isRestoreTransaction()

setRestoreTransaction

public void setRestoreTransaction(boolean restoreTransaction)

isTrackMessages

public boolean isTrackMessages()

setTrackMessages

public void setTrackMessages(boolean trackMessages)

getMaxCacheSize

public int getMaxCacheSize()

setMaxCacheSize

public void setMaxCacheSize(int maxCacheSize)

connectionInterruptProcessingComplete

public void connectionInterruptProcessingComplete(Transport transport,
                                                  ConnectionId connectionId)

transportInterrupted

public void transportInterrupted(ConnectionId connectionId)


Copyright © 2005-2013 The Apache Software Foundation. All Rights Reserved.