Package org.apache.activemq.state
Class ConnectionStateTracker
java.lang.Object
org.apache.activemq.state.CommandVisitorAdapter
org.apache.activemq.state.ConnectionStateTracker
- All Implemented Interfaces:
CommandVisitor
Tracks the state of a connection so a newly established transport can be
re-initialized to the state that was tracked.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconnectionInterruptProcessingComplete(Transport transport, ConnectionId connectionId) longintbooleanbooleanbooleanbooleanbooleanbooleanbooleanprocessAddSession(SessionInfo info) processMessage(Message send) processRemoveConnection(ConnectionId id, long lastDeliveredSequenceId) processRemoveConsumer(ConsumerId id, long lastDeliveredSequenceId) processRemoveSession(SessionId id, long lastDeliveredSequenceId) voidprotected voidrestoreConsumers(Transport transport, SessionState sessionState) protected voidrestoreProducers(Transport transport, SessionState sessionState) protected voidrestoreSessions(Transport transport, ConnectionState connectionState) protected voidrestoreTempDestinations(Transport transport, ConnectionState connectionState) voidsetMaxCacheSize(int maxCacheSize) voidsetRestoreConsumers(boolean restoreConsumers) voidsetRestoreProducers(boolean restoreProducers) voidsetRestoreSessions(boolean restoreSessions) voidsetRestoreTransaction(boolean restoreTransaction) voidsetTrackMessages(boolean trackMessages) voidsetTrackTransactionProducers(boolean trackTransactionProducers) voidsetTrackTransactions(boolean trackTransactions) Entry point for all tracked commands in the tracker.voidCompletes the two phase tracking operation for a command that is sent on the wire.voidtransportInterrupted(ConnectionId connectionId) Methods inherited from class org.apache.activemq.state.CommandVisitorAdapter
processBrokerInfo, processBrokerSubscriptionInfo, processConnectionControl, processConnectionError, processConsumerControl, processControlCommand, processFlush, processForgetTransaction, processKeepAlive, processMessageAck, processMessageDispatch, processMessageDispatchNotification, processProducerAck, processRecoverTransactions, processRemoveSubscription, processShutdown, processWireFormat
-
Field Details
-
connectionStates
-
-
Constructor Details
-
ConnectionStateTracker
public ConnectionStateTracker()
-
-
Method Details
-
track
Entry point for all tracked commands in the tracker. Commands should be tracked before there is an attempt to send them on the wire. Upon a successful send of a command it is necessary to call the trackBack method to complete the tracking of the given command.- Parameters:
command- The command that is to be tracked by this tracker.- Returns:
- null if the command is not state tracked.
- Throws:
IOException- if an error occurs during setup of the tracking operation.
-
trackBack
Completes the two phase tracking operation for a command that is sent on the wire. Once the command is sent successfully to complete the tracking operation or otherwise update the state of the tracker.- Parameters:
command- The command that was previously provided to the track method.
-
restore
- Throws:
IOException
-
restoreSessions
protected void restoreSessions(Transport transport, ConnectionState connectionState) throws IOException - Parameters:
transport-connectionState-- Throws:
IOException
-
restoreConsumers
- Parameters:
transport-sessionState-- Throws:
IOException
-
restoreProducers
- Parameters:
transport-sessionState-- Throws:
IOException
-
restoreTempDestinations
protected void restoreTempDestinations(Transport transport, ConnectionState connectionState) throws IOException - Parameters:
transport-connectionState-- Throws:
IOException
-
processAddDestination
- Specified by:
processAddDestinationin interfaceCommandVisitor- Overrides:
processAddDestinationin classCommandVisitorAdapter
-
processRemoveDestination
- Specified by:
processRemoveDestinationin interfaceCommandVisitor- Overrides:
processRemoveDestinationin classCommandVisitorAdapter
-
processAddProducer
- Specified by:
processAddProducerin interfaceCommandVisitor- Overrides:
processAddProducerin classCommandVisitorAdapter
-
processRemoveProducer
- Specified by:
processRemoveProducerin interfaceCommandVisitor- Overrides:
processRemoveProducerin classCommandVisitorAdapter
-
processAddConsumer
- Specified by:
processAddConsumerin interfaceCommandVisitor- Overrides:
processAddConsumerin classCommandVisitorAdapter
-
processRemoveConsumer
- Specified by:
processRemoveConsumerin interfaceCommandVisitor- Overrides:
processRemoveConsumerin classCommandVisitorAdapter
-
processAddSession
- Specified by:
processAddSessionin interfaceCommandVisitor- Overrides:
processAddSessionin classCommandVisitorAdapter
-
processRemoveSession
- Specified by:
processRemoveSessionin interfaceCommandVisitor- Overrides:
processRemoveSessionin classCommandVisitorAdapter
-
processAddConnection
- Specified by:
processAddConnectionin interfaceCommandVisitor- Overrides:
processAddConnectionin classCommandVisitorAdapter
-
processRemoveConnection
public Response processRemoveConnection(ConnectionId id, long lastDeliveredSequenceId) throws Exception - Specified by:
processRemoveConnectionin interfaceCommandVisitor- Overrides:
processRemoveConnectionin classCommandVisitorAdapter- Throws:
Exception
-
processMessage
- Specified by:
processMessagein interfaceCommandVisitor- Overrides:
processMessagein classCommandVisitorAdapter- Throws:
Exception
-
processBeginTransaction
- Specified by:
processBeginTransactionin interfaceCommandVisitor- Overrides:
processBeginTransactionin classCommandVisitorAdapter
-
processPrepareTransaction
- Specified by:
processPrepareTransactionin interfaceCommandVisitor- Overrides:
processPrepareTransactionin classCommandVisitorAdapter- Throws:
Exception
-
processCommitTransactionOnePhase
- Specified by:
processCommitTransactionOnePhasein interfaceCommandVisitor- Overrides:
processCommitTransactionOnePhasein classCommandVisitorAdapter- Throws:
Exception
-
processCommitTransactionTwoPhase
- Specified by:
processCommitTransactionTwoPhasein interfaceCommandVisitor- Overrides:
processCommitTransactionTwoPhasein classCommandVisitorAdapter- Throws:
Exception
-
processRollbackTransaction
- Specified by:
processRollbackTransactionin interfaceCommandVisitor- Overrides:
processRollbackTransactionin classCommandVisitorAdapter- Throws:
Exception
-
processEndTransaction
- Specified by:
processEndTransactionin interfaceCommandVisitor- Overrides:
processEndTransactionin classCommandVisitorAdapter- Throws:
Exception
-
processMessagePull
- Specified by:
processMessagePullin interfaceCommandVisitor- Overrides:
processMessagePullin classCommandVisitorAdapter- 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) -
getCurrentCacheSize
public long getCurrentCacheSize()- Returns:
- the current cache size for the Message and MessagePull Command cache.
-
connectionInterruptProcessingComplete
-
transportInterrupted
-