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 interface
MemoryTransactionStore.AddMessageCommand
static interface
MemoryTransactionStore.RemoveMessageCommand
class
MemoryTransactionStore.Tx
-
Field Summary
Fields Modifier and Type Field Description protected BrokerService
brokerService
protected ConcurrentMap<Object,MemoryTransactionStore.Tx>
inflightTransactions
protected PersistenceAdapter
persistenceAdapter
protected 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 void
acknowledge(TopicMessageStore destination, String clientId, String subscriptionName, org.apache.activemq.command.MessageId messageId, org.apache.activemq.command.MessageAck ack)
void
commit(org.apache.activemq.command.TransactionId txid, boolean wasPrepared, Runnable preCommit, Runnable postCommit)
void
delete()
MemoryTransactionStore.Tx
getPreparedTx(org.apache.activemq.command.TransactionId txid)
MemoryTransactionStore.Tx
getTx(Object txid)
protected void
onProxyQueueStore(ProxyMessageStore proxyMessageStore)
protected void
onProxyTopicStore(ProxyTopicMessageStore proxyTopicMessageStore)
protected void
onRecovered(MemoryTransactionStore.Tx tx)
void
prepare(org.apache.activemq.command.TransactionId txid)
MessageStore
proxy(MessageStore messageStore)
TopicMessageStore
proxy(TopicMessageStore messageStore)
void
recover(TransactionRecoveryListener listener)
void
rollback(org.apache.activemq.command.TransactionId txid)
void
start()
void
stop()
-
-
-
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:
prepare
in 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:
commit
in interfaceTransactionStore
- Throws:
IOException
-
rollback
public void rollback(org.apache.activemq.command.TransactionId txid) throws IOException
- Specified by:
rollback
in interfaceTransactionStore
- Throws:
IOException
- See Also:
TransactionStore.rollback(TransactionId)
-
start
public void start() throws Exception
- Specified by:
start
in interfaceorg.apache.activemq.Service
- Throws:
Exception
-
stop
public void stop() throws Exception
- Specified by:
stop
in interfaceorg.apache.activemq.Service
- Throws:
Exception
-
recover
public void recover(TransactionRecoveryListener listener) throws IOException
- Specified by:
recover
in 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()
-
-