org.apache.activemq.store.memory
Class MemoryTransactionStore

java.lang.Object
  extended by org.apache.activemq.store.memory.MemoryTransactionStore
All Implemented Interfaces:
Service, TransactionStore
Direct Known Subclasses:
JdbcMemoryTransactionStore

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
static interface MemoryTransactionStore.AddMessageCommand
           
static interface MemoryTransactionStore.RemoveMessageCommand
           
 class MemoryTransactionStore.Tx
           
 
Field Summary
protected  ConcurrentHashMap<Object,MemoryTransactionStore.Tx> inflightTransactions
           
protected  PersistenceAdapter persistenceAdapter
           
protected  ConcurrentHashMap<TransactionId,MemoryTransactionStore.Tx> preparedTransactions
           
 
Constructor Summary
MemoryTransactionStore(PersistenceAdapter persistenceAdapter)
           
 
Method Summary
 void acknowledge(TopicMessageStore destination, String clientId, String subscriptionName, MessageId messageId, MessageAck ack)
           
 void commit(TransactionId txid, boolean wasPrepared, Runnable preCommit, Runnable postCommit)
           
 void delete()
           
 MemoryTransactionStore.Tx getPreparedTx(TransactionId txid)
           
 MemoryTransactionStore.Tx getTx(Object txid)
           
protected  void onProxyTopicStore(ProxyTopicMessageStore proxyTopicMessageStore)
           
protected  void onRecovered(MemoryTransactionStore.Tx tx)
           
 void prepare(TransactionId txid)
           
 MessageStore proxy(MessageStore messageStore)
           
 TopicMessageStore proxy(TopicMessageStore messageStore)
           
 void recover(TransactionRecoveryListener listener)
           
 void rollback(TransactionId txid)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inflightTransactions

protected ConcurrentHashMap<Object,MemoryTransactionStore.Tx> inflightTransactions

preparedTransactions

protected ConcurrentHashMap<TransactionId,MemoryTransactionStore.Tx> preparedTransactions

persistenceAdapter

protected final PersistenceAdapter persistenceAdapter
Constructor Detail

MemoryTransactionStore

public MemoryTransactionStore(PersistenceAdapter persistenceAdapter)
Method Detail

proxy

public MessageStore proxy(MessageStore messageStore)

proxy

public TopicMessageStore proxy(TopicMessageStore messageStore)

onProxyTopicStore

protected void onProxyTopicStore(ProxyTopicMessageStore proxyTopicMessageStore)

prepare

public void prepare(TransactionId txid)
             throws IOException
Specified by:
prepare in interface TransactionStore
Throws:
IOException
See Also:
TransactionStore.prepare(TransactionId)

getTx

public MemoryTransactionStore.Tx getTx(Object txid)

getPreparedTx

public MemoryTransactionStore.Tx getPreparedTx(TransactionId txid)

commit

public void commit(TransactionId txid,
                   boolean wasPrepared,
                   Runnable preCommit,
                   Runnable postCommit)
            throws IOException
Specified by:
commit in interface TransactionStore
Throws:
IOException

rollback

public void rollback(TransactionId txid)
              throws IOException
Specified by:
rollback in interface TransactionStore
Throws:
IOException
See Also:
TransactionStore.rollback(TransactionId)

start

public void start()
           throws Exception
Specified by:
start in interface Service
Throws:
Exception

stop

public void stop()
          throws Exception
Specified by:
stop in interface Service
Throws:
Exception

recover

public void recover(TransactionRecoveryListener listener)
             throws IOException
Specified by:
recover in interface TransactionStore
Throws:
IOException

onRecovered

protected void onRecovered(MemoryTransactionStore.Tx tx)

acknowledge

public void acknowledge(TopicMessageStore destination,
                        String clientId,
                        String subscriptionName,
                        MessageId messageId,
                        MessageAck ack)
                 throws IOException
Throws:
IOException

delete

public void delete()


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