org.apache.activemq.store.kahadb
Class MultiKahaDBPersistenceAdapter

java.lang.Object
  extended by org.apache.activemq.util.ServiceSupport
      extended by org.apache.activemq.broker.LockableServiceSupport
          extended by org.apache.activemq.store.kahadb.MultiKahaDBPersistenceAdapter
All Implemented Interfaces:
BrokerServiceAware, Lockable, org.apache.activemq.Service, PersistenceAdapter

public class MultiKahaDBPersistenceAdapter
extends LockableServiceSupport
implements PersistenceAdapter, BrokerServiceAware

An implementation of PersistenceAdapter that supports distribution of destinations across multiple kahaDB persistence adapters


Constructor Summary
MultiKahaDBPersistenceAdapter()
           
 
Method Summary
 void beginTransaction(ConnectionContext context)
           
 void checkpoint(boolean sync)
           
 void commitTransaction(ConnectionContext context)
           
 Locker createDefaultLocker()
           
 MessageStore createQueueMessageStore(org.apache.activemq.command.ActiveMQQueue destination)
           
 TopicMessageStore createTopicMessageStore(org.apache.activemq.command.ActiveMQTopic destination)
           
 TransactionStore createTransactionStore()
           
 void deleteAllMessages()
           
 void doStart()
           
protected  void doStop(ServiceStopper stopper)
           
 BrokerService getBrokerService()
           
 Set<org.apache.activemq.command.ActiveMQDestination> getDestinations()
           
 File getDirectory()
           
 int getJournalMaxFileLength()
           
 int getJournalWriteBatchSize()
           
 long getLastMessageBrokerSequenceId()
           
 long getLastProducerSequenceId(org.apache.activemq.command.ProducerId id)
           
 void init()
           
 boolean isLocalXid(org.apache.activemq.command.TransactionId xid)
           
 void removeQueueMessageStore(org.apache.activemq.command.ActiveMQQueue destination)
           
 void removeTopicMessageStore(org.apache.activemq.command.ActiveMQTopic destination)
           
 void rollbackTransaction(ConnectionContext context)
           
 void setBrokerName(String brokerName)
           
 void setBrokerService(BrokerService brokerService)
           
 void setDirectory(File directory)
           
 void setFilteredPersistenceAdapters(List entries)
          Sets the FilteredKahaDBPersistenceAdapter entries
 void setJournalMaxFileLength(int maxFileLength)
          Set the max file length of the transaction journal When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used
 void setJournalWriteBatchSize(int journalWriteBatchSize)
          Set the max write batch size of the transaction journal When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used
 void setTransactionStore(MultiKahaDBTransactionStore transactionStore)
           
 void setUsageManager(SystemUsage usageManager)
           
 long size()
           
 String toString()
           
 
Methods inherited from class org.apache.activemq.broker.LockableServiceSupport
getLocker, getLockKeepAlivePeriod, getScheduledThreadPoolExecutor, isUseLock, keepLockAlive, postStop, preStart, setLocker, setLockKeepAlivePeriod, setUseLock, stopBroker
 
Methods inherited from class org.apache.activemq.util.ServiceSupport
addServiceListener, dispose, isStarted, isStopped, isStopping, removeServiceListener, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.activemq.Service
start, stop
 

Constructor Detail

MultiKahaDBPersistenceAdapter

public MultiKahaDBPersistenceAdapter()
Method Detail

setFilteredPersistenceAdapters

public void setFilteredPersistenceAdapters(List entries)
Sets the FilteredKahaDBPersistenceAdapter entries


isLocalXid

public boolean isLocalXid(org.apache.activemq.command.TransactionId xid)

beginTransaction

public void beginTransaction(ConnectionContext context)
                      throws IOException
Specified by:
beginTransaction in interface PersistenceAdapter
Throws:
IOException

checkpoint

public void checkpoint(boolean sync)
                throws IOException
Specified by:
checkpoint in interface PersistenceAdapter
Throws:
IOException

commitTransaction

public void commitTransaction(ConnectionContext context)
                       throws IOException
Specified by:
commitTransaction in interface PersistenceAdapter
Throws:
IOException

createQueueMessageStore

public MessageStore createQueueMessageStore(org.apache.activemq.command.ActiveMQQueue destination)
                                     throws IOException
Specified by:
createQueueMessageStore in interface PersistenceAdapter
Throws:
IOException

createTopicMessageStore

public TopicMessageStore createTopicMessageStore(org.apache.activemq.command.ActiveMQTopic destination)
                                          throws IOException
Specified by:
createTopicMessageStore in interface PersistenceAdapter
Throws:
IOException

createTransactionStore

public TransactionStore createTransactionStore()
                                        throws IOException
Specified by:
createTransactionStore in interface PersistenceAdapter
Throws:
IOException

deleteAllMessages

public void deleteAllMessages()
                       throws IOException
Specified by:
deleteAllMessages in interface PersistenceAdapter
Throws:
IOException

getDestinations

public Set<org.apache.activemq.command.ActiveMQDestination> getDestinations()
Specified by:
getDestinations in interface PersistenceAdapter

getLastMessageBrokerSequenceId

public long getLastMessageBrokerSequenceId()
                                    throws IOException
Specified by:
getLastMessageBrokerSequenceId in interface PersistenceAdapter
Throws:
IOException

getLastProducerSequenceId

public long getLastProducerSequenceId(org.apache.activemq.command.ProducerId id)
                               throws IOException
Specified by:
getLastProducerSequenceId in interface PersistenceAdapter
Throws:
IOException

removeQueueMessageStore

public void removeQueueMessageStore(org.apache.activemq.command.ActiveMQQueue destination)
Specified by:
removeQueueMessageStore in interface PersistenceAdapter

removeTopicMessageStore

public void removeTopicMessageStore(org.apache.activemq.command.ActiveMQTopic destination)
Specified by:
removeTopicMessageStore in interface PersistenceAdapter

rollbackTransaction

public void rollbackTransaction(ConnectionContext context)
                         throws IOException
Specified by:
rollbackTransaction in interface PersistenceAdapter
Throws:
IOException

setBrokerName

public void setBrokerName(String brokerName)
Specified by:
setBrokerName in interface PersistenceAdapter

setUsageManager

public void setUsageManager(SystemUsage usageManager)
Specified by:
setUsageManager in interface PersistenceAdapter

size

public long size()
Specified by:
size in interface PersistenceAdapter

doStart

public void doStart()
             throws Exception
Specified by:
doStart in class ServiceSupport
Throws:
Exception

doStop

protected void doStop(ServiceStopper stopper)
               throws Exception
Specified by:
doStop in class ServiceSupport
Throws:
Exception

getDirectory

public File getDirectory()
Specified by:
getDirectory in interface PersistenceAdapter

setDirectory

public void setDirectory(File directory)
Specified by:
setDirectory in interface PersistenceAdapter

init

public void init()
          throws Exception
Specified by:
init in class LockableServiceSupport
Throws:
Exception

setBrokerService

public void setBrokerService(BrokerService brokerService)
Specified by:
setBrokerService in interface BrokerServiceAware
Overrides:
setBrokerService in class LockableServiceSupport

getBrokerService

public BrokerService getBrokerService()
Overrides:
getBrokerService in class LockableServiceSupport

setTransactionStore

public void setTransactionStore(MultiKahaDBTransactionStore transactionStore)

setJournalMaxFileLength

public void setJournalMaxFileLength(int maxFileLength)
Set the max file length of the transaction journal When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used


getJournalMaxFileLength

public int getJournalMaxFileLength()

setJournalWriteBatchSize

public void setJournalWriteBatchSize(int journalWriteBatchSize)
Set the max write batch size of the transaction journal When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used


getJournalWriteBatchSize

public int getJournalWriteBatchSize()

toString

public String toString()
Overrides:
toString in class Object

createDefaultLocker

public Locker createDefaultLocker()
                           throws IOException
Specified by:
createDefaultLocker in interface Lockable
Throws:
IOException


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