org.apache.activemq.store
Interface PersistenceAdapter

All Superinterfaces:
Service
All Known Implementing Classes:
JDBCPersistenceAdapter, JournalPersistenceAdapter, KahaPersistenceAdapter, MemoryPersistenceAdapter, QuickJournalPersistenceAdapter, RapidPersistenceAdapter

public interface PersistenceAdapter
extends Service

Adapter to the actual persistence mechanism used with ActiveMQ

Version:
$Revision: 1.3 $

Method Summary
 void beginTransaction(ConnectionContext context)
          This method starts a transaction on the persistent storage - which is nothing to do with JMS or XA transactions - its purely a mechanism to perform multiple writes to a persistent store in 1 transaction as a performance optimization.
 void commitTransaction(ConnectionContext context)
          Commit a persistence transaction
 MessageStore createQueueMessageStore(ActiveMQQueue destination)
          Factory method to create a new queue message store with the given destination name
 TopicMessageStore createTopicMessageStore(ActiveMQTopic destination)
          Factory method to create a new topic message store with the given destination name
 TransactionStore createTransactionStore()
          Factory method to create a new persistent prepared transaction store for XA recovery
 void deleteAllMessages()
          Delete's all the messages in the persistent store.
 java.util.Set getDestinations()
          Returns a set of all the ActiveMQDestination objects that the persistence store is aware exist.
 long getLastMessageBrokerSequenceId()
           
 boolean isUseExternalMessageReferences()
           
 void rollbackTransaction(ConnectionContext context)
          Rollback a persistence transaction
 void setUsageManager(UsageManager usageManager)
           
 void setUseExternalMessageReferences(boolean enable)
           
 
Methods inherited from interface org.apache.activemq.Service
start, stop
 

Method Detail

getDestinations

java.util.Set getDestinations()
Returns a set of all the ActiveMQDestination objects that the persistence store is aware exist.

Returns:

createQueueMessageStore

MessageStore createQueueMessageStore(ActiveMQQueue destination)
                                     throws java.io.IOException
Factory method to create a new queue message store with the given destination name

Throws:
java.io.IOException

createTopicMessageStore

TopicMessageStore createTopicMessageStore(ActiveMQTopic destination)
                                          throws java.io.IOException
Factory method to create a new topic message store with the given destination name

Throws:
java.io.IOException

createTransactionStore

TransactionStore createTransactionStore()
                                        throws java.io.IOException
Factory method to create a new persistent prepared transaction store for XA recovery

Throws:
java.io.IOException

beginTransaction

void beginTransaction(ConnectionContext context)
                      throws java.io.IOException
This method starts a transaction on the persistent storage - which is nothing to do with JMS or XA transactions - its purely a mechanism to perform multiple writes to a persistent store in 1 transaction as a performance optimization.

Typically one transaction will require one disk synchronization point and so for real high performance its usually faster to perform many writes within the same transaction to minimize latency caused by disk synchronization. This is especially true when using tools like Berkeley Db or embedded JDBC servers.

Throws:
java.io.IOException

commitTransaction

void commitTransaction(ConnectionContext context)
                       throws java.io.IOException
Commit a persistence transaction

Throws:
java.io.IOException
See Also:
PersistenceAdapter#beginTransaction()

rollbackTransaction

void rollbackTransaction(ConnectionContext context)
                         throws java.io.IOException
Rollback a persistence transaction

Throws:
java.io.IOException
See Also:
PersistenceAdapter#beginTransaction()

getLastMessageBrokerSequenceId

long getLastMessageBrokerSequenceId()
                                    throws java.io.IOException
Returns:
Throws:
java.io.IOException

deleteAllMessages

void deleteAllMessages()
                       throws java.io.IOException
Delete's all the messages in the persistent store.

Throws:
java.io.IOException

isUseExternalMessageReferences

boolean isUseExternalMessageReferences()

setUseExternalMessageReferences

void setUseExternalMessageReferences(boolean enable)

setUsageManager

void setUsageManager(UsageManager usageManager)
Parameters:
usageManager - The UsageManager that is controlling the broker's memory usage.


Copyright © 2011 Apache Software Foundation. All Rights Reserved.