Package org.apache.activemq.store.memory
Class MemoryTransactionStore
- java.lang.Object
-
- org.apache.activemq.store.memory.MemoryTransactionStore
-
- All Implemented Interfaces:
org.apache.activemq.Service,TransactionStore
public class MemoryTransactionStore extends Object implements TransactionStore
Provides a TransactionStore implementation that can create transaction aware MessageStore objects from non transaction aware MessageStore objects.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceMemoryTransactionStore.AddMessageCommandstatic interfaceMemoryTransactionStore.RemoveMessageCommandclassMemoryTransactionStore.Tx
-
Field Summary
Fields Modifier and Type Field Description protected BrokerServicebrokerServiceprotected ConcurrentMap<Object,MemoryTransactionStore.Tx>inflightTransactionsprotected PersistenceAdapterpersistenceAdapterprotected Map<org.apache.activemq.command.TransactionId,MemoryTransactionStore.Tx>preparedTransactions
-
Constructor Summary
Constructors Constructor Description MemoryTransactionStore(PersistenceAdapter persistenceAdapter, BrokerService brokerService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacknowledge(TopicMessageStore destination, String clientId, String subscriptionName, org.apache.activemq.command.MessageId messageId, org.apache.activemq.command.MessageAck ack)voidcommit(org.apache.activemq.command.TransactionId txid, boolean wasPrepared, Runnable preCommit, Runnable postCommit)voiddelete()MemoryTransactionStore.TxgetPreparedTx(org.apache.activemq.command.TransactionId txid)MemoryTransactionStore.TxgetTx(Object txid)protected voidonProxyQueueStore(ProxyMessageStore proxyMessageStore)protected voidonProxyTopicStore(ProxyTopicMessageStore proxyTopicMessageStore)protected voidonRecovered(MemoryTransactionStore.Tx tx)voidprepare(org.apache.activemq.command.TransactionId txid)MessageStoreproxy(MessageStore messageStore)TopicMessageStoreproxy(TopicMessageStore messageStore)voidrecover(TransactionRecoveryListener listener)voidrollback(org.apache.activemq.command.TransactionId txid)voidstart()voidstop()
-
-
-
Field Detail
-
inflightTransactions
protected ConcurrentMap<Object,MemoryTransactionStore.Tx> inflightTransactions
-
preparedTransactions
protected Map<org.apache.activemq.command.TransactionId,MemoryTransactionStore.Tx> preparedTransactions
-
persistenceAdapter
protected final PersistenceAdapter persistenceAdapter
-
brokerService
protected final BrokerService brokerService
-
-
Constructor Detail
-
MemoryTransactionStore
public MemoryTransactionStore(PersistenceAdapter persistenceAdapter, BrokerService brokerService)
-
-
Method Detail
-
proxy
public MessageStore proxy(MessageStore messageStore)
-
onProxyQueueStore
protected void onProxyQueueStore(ProxyMessageStore proxyMessageStore)
-
proxy
public TopicMessageStore proxy(TopicMessageStore messageStore)
-
onProxyTopicStore
protected void onProxyTopicStore(ProxyTopicMessageStore proxyTopicMessageStore)
-
prepare
public void prepare(org.apache.activemq.command.TransactionId txid) throws IOException- Specified by:
preparein interfaceTransactionStore- Throws:
IOException- See Also:
TransactionStore.prepare(TransactionId)
-
getTx
public MemoryTransactionStore.Tx getTx(Object txid)
-
getPreparedTx
public MemoryTransactionStore.Tx getPreparedTx(org.apache.activemq.command.TransactionId txid)
-
commit
public void commit(org.apache.activemq.command.TransactionId txid, boolean wasPrepared, Runnable preCommit, Runnable postCommit) throws IOException- Specified by:
commitin interfaceTransactionStore- Throws:
IOException
-
rollback
public void rollback(org.apache.activemq.command.TransactionId txid) throws IOException- Specified by:
rollbackin interfaceTransactionStore- Throws:
IOException- See Also:
TransactionStore.rollback(TransactionId)
-
start
public void start() throws Exception- Specified by:
startin interfaceorg.apache.activemq.Service- Throws:
Exception
-
stop
public void stop() throws Exception- Specified by:
stopin interfaceorg.apache.activemq.Service- Throws:
Exception
-
recover
public void recover(TransactionRecoveryListener listener) throws IOException
- Specified by:
recoverin interfaceTransactionStore- Throws:
IOException
-
onRecovered
protected void onRecovered(MemoryTransactionStore.Tx tx)
-
acknowledge
public void acknowledge(TopicMessageStore destination, String clientId, String subscriptionName, org.apache.activemq.command.MessageId messageId, org.apache.activemq.command.MessageAck ack) throws IOException
- Throws:
IOException
-
delete
public void delete()
-
-