org.apache.activemq.store.kahadaptor
Class KahaPersistenceAdapter

java.lang.Object
  extended by org.apache.activemq.store.kahadaptor.KahaPersistenceAdapter
All Implemented Interfaces:
Service, PersistenceAdapter

public class KahaPersistenceAdapter
extends java.lang.Object
implements PersistenceAdapter

Version:
$Revision: 1.4 $

Constructor Summary
KahaPersistenceAdapter(java.io.File dir)
           
 
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.
 java.lang.String getIndexType()
           
 long getLastMessageBrokerSequenceId()
           
protected  ListContainer getListContainer(java.lang.Object id, java.lang.String containerName)
           
protected  MapContainer getMapContainer(java.lang.Object id, java.lang.String containerName)
           
 long getMaxDataFileLength()
           
protected  Store getStore()
           
 boolean isUseExternalMessageReferences()
           
protected  MessageStore retrieveMessageStore(java.lang.Object id)
           
 void rollbackTransaction(ConnectionContext context)
          Rollback a persistence transaction
 void setIndexType(java.lang.String indexType)
           
 void setMaxDataFileLength(long maxDataFileLength)
           
 void setUsageManager(UsageManager usageManager)
           
 void setUseExternalMessageReferences(boolean useExternalMessageReferences)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KahaPersistenceAdapter

public KahaPersistenceAdapter(java.io.File dir)
                       throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getDestinations

public java.util.Set getDestinations()
Description copied from interface: PersistenceAdapter
Returns a set of all the ActiveMQDestination objects that the persistence store is aware exist.

Specified by:
getDestinations in interface PersistenceAdapter
Returns:

createQueueMessageStore

public MessageStore createQueueMessageStore(ActiveMQQueue destination)
                                     throws java.io.IOException
Description copied from interface: PersistenceAdapter
Factory method to create a new queue message store with the given destination name

Specified by:
createQueueMessageStore in interface PersistenceAdapter
Throws:
java.io.IOException

createTopicMessageStore

public TopicMessageStore createTopicMessageStore(ActiveMQTopic destination)
                                          throws java.io.IOException
Description copied from interface: PersistenceAdapter
Factory method to create a new topic message store with the given destination name

Specified by:
createTopicMessageStore in interface PersistenceAdapter
Throws:
java.io.IOException

retrieveMessageStore

protected MessageStore retrieveMessageStore(java.lang.Object id)

createTransactionStore

public TransactionStore createTransactionStore()
                                        throws java.io.IOException
Description copied from interface: PersistenceAdapter
Factory method to create a new persistent prepared transaction store for XA recovery

Specified by:
createTransactionStore in interface PersistenceAdapter
Throws:
java.io.IOException

beginTransaction

public void beginTransaction(ConnectionContext context)
Description copied from interface: PersistenceAdapter
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.

Specified by:
beginTransaction in interface PersistenceAdapter

commitTransaction

public void commitTransaction(ConnectionContext context)
                       throws java.io.IOException
Description copied from interface: PersistenceAdapter
Commit a persistence transaction

Specified by:
commitTransaction in interface PersistenceAdapter
Throws:
java.io.IOException
See Also:
PersistenceAdapter#beginTransaction()

rollbackTransaction

public void rollbackTransaction(ConnectionContext context)
Description copied from interface: PersistenceAdapter
Rollback a persistence transaction

Specified by:
rollbackTransaction in interface PersistenceAdapter
See Also:
PersistenceAdapter#beginTransaction()

start

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

stop

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

getLastMessageBrokerSequenceId

public long getLastMessageBrokerSequenceId()
                                    throws java.io.IOException
Specified by:
getLastMessageBrokerSequenceId in interface PersistenceAdapter
Returns:
Throws:
java.io.IOException

deleteAllMessages

public void deleteAllMessages()
                       throws java.io.IOException
Description copied from interface: PersistenceAdapter
Delete's all the messages in the persistent store.

Specified by:
deleteAllMessages in interface PersistenceAdapter
Throws:
java.io.IOException

isUseExternalMessageReferences

public boolean isUseExternalMessageReferences()
Specified by:
isUseExternalMessageReferences in interface PersistenceAdapter

setUseExternalMessageReferences

public void setUseExternalMessageReferences(boolean useExternalMessageReferences)
Specified by:
setUseExternalMessageReferences in interface PersistenceAdapter

getMapContainer

protected MapContainer getMapContainer(java.lang.Object id,
                                       java.lang.String containerName)
                                throws java.io.IOException
Throws:
java.io.IOException

getListContainer

protected ListContainer getListContainer(java.lang.Object id,
                                         java.lang.String containerName)
                                  throws java.io.IOException
Throws:
java.io.IOException

setUsageManager

public void setUsageManager(UsageManager usageManager)
Specified by:
setUsageManager in interface PersistenceAdapter
Parameters:
usageManager - The UsageManager that is controlling the broker's memory usage.

getMaxDataFileLength

public long getMaxDataFileLength()
Returns:
the maxDataFileLength

setMaxDataFileLength

public void setMaxDataFileLength(long maxDataFileLength)
Parameters:
maxDataFileLength - the maxDataFileLength to set

getIndexType

public java.lang.String getIndexType()
Returns:
the indexType

setIndexType

public void setIndexType(java.lang.String indexType)
Parameters:
indexType - the indexTypes to set

getStore

protected Store getStore()
                  throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2010 Apache Software Foundation. All Rights Reserved.