Class MultiKahaDBPersistenceAdapter

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

public class MultiKahaDBPersistenceAdapter extends org.apache.activemq.broker.LockableServiceSupport implements org.apache.activemq.store.PersistenceAdapter, org.apache.activemq.broker.BrokerServiceAware, org.apache.activemq.store.NoLocalSubscriptionAware
An implementation of PersistenceAdapter that supports distribution of destinations across multiple kahaDB persistence adapters
  • Constructor Details

    • MultiKahaDBPersistenceAdapter

      public MultiKahaDBPersistenceAdapter()
  • Method Details

    • setFilteredPersistenceAdapters

      public void setFilteredPersistenceAdapters(List entries)
      Sets the FilteredKahaDBPersistenceAdapter entries
    • nameFromDestinationFilter

      public static String nameFromDestinationFilter(org.apache.activemq.command.ActiveMQDestination destination)
    • isLocalXid

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

      public void beginTransaction(org.apache.activemq.broker.ConnectionContext context) throws IOException
      Specified by:
      beginTransaction in interface org.apache.activemq.store.PersistenceAdapter
      Throws:
      IOException
    • checkpoint

      public void checkpoint(boolean cleanup) throws IOException
      Specified by:
      checkpoint in interface org.apache.activemq.store.PersistenceAdapter
      Throws:
      IOException
    • commitTransaction

      public void commitTransaction(org.apache.activemq.broker.ConnectionContext context) throws IOException
      Specified by:
      commitTransaction in interface org.apache.activemq.store.PersistenceAdapter
      Throws:
      IOException
    • createQueueMessageStore

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

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

      public org.apache.activemq.store.TransactionStore createTransactionStore() throws IOException
      Specified by:
      createTransactionStore in interface org.apache.activemq.store.PersistenceAdapter
      Throws:
      IOException
    • deleteAllMessages

      public void deleteAllMessages() throws IOException
      Specified by:
      deleteAllMessages in interface org.apache.activemq.store.PersistenceAdapter
      Throws:
      IOException
    • getDestinations

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

      public long getLastMessageBrokerSequenceId() throws IOException
      Specified by:
      getLastMessageBrokerSequenceId in interface org.apache.activemq.store.PersistenceAdapter
      Throws:
      IOException
    • getLastProducerSequenceId

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

      public void allowIOResumption()
      Specified by:
      allowIOResumption in interface org.apache.activemq.store.PersistenceAdapter
    • removeQueueMessageStore

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

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

      public void rollbackTransaction(org.apache.activemq.broker.ConnectionContext context) throws IOException
      Specified by:
      rollbackTransaction in interface org.apache.activemq.store.PersistenceAdapter
      Throws:
      IOException
    • setBrokerName

      public void setBrokerName(String brokerName)
      Specified by:
      setBrokerName in interface org.apache.activemq.store.PersistenceAdapter
    • setUsageManager

      public void setUsageManager(org.apache.activemq.usage.SystemUsage usageManager)
      Specified by:
      setUsageManager in interface org.apache.activemq.store.PersistenceAdapter
    • size

      public long size()
      Specified by:
      size in interface org.apache.activemq.store.PersistenceAdapter
    • doStart

      public void doStart() throws Exception
      Specified by:
      doStart in class org.apache.activemq.util.ServiceSupport
      Throws:
      Exception
    • doStop

      protected void doStop(org.apache.activemq.util.ServiceStopper stopper) throws Exception
      Specified by:
      doStop in class org.apache.activemq.util.ServiceSupport
      Throws:
      Exception
    • getDirectory

      public File getDirectory()
      Specified by:
      getDirectory in interface org.apache.activemq.store.PersistenceAdapter
    • setDirectory

      public void setDirectory(File directory)
      Specified by:
      setDirectory in interface org.apache.activemq.store.PersistenceAdapter
    • init

      public void init() throws Exception
      Specified by:
      init in class org.apache.activemq.broker.LockableServiceSupport
      Throws:
      Exception
    • setBrokerService

      public void setBrokerService(org.apache.activemq.broker.BrokerService brokerService)
      Specified by:
      setBrokerService in interface org.apache.activemq.broker.BrokerServiceAware
      Overrides:
      setBrokerService in class org.apache.activemq.broker.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()
    • setJournalCleanupInterval

      public void setJournalCleanupInterval(long journalCleanupInterval)
    • getJournalCleanupInterval

      public long getJournalCleanupInterval()
    • setCheckForCorruption

      public void setCheckForCorruption(boolean checkForCorruption)
    • isCheckForCorruption

      public boolean isCheckForCorruption()
    • getAdapters

      public List<org.apache.activemq.store.PersistenceAdapter> getAdapters()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • createDefaultLocker

      public org.apache.activemq.broker.Locker createDefaultLocker() throws IOException
      Specified by:
      createDefaultLocker in interface org.apache.activemq.broker.Lockable
      Throws:
      IOException
    • createJobSchedulerStore

      public org.apache.activemq.broker.scheduler.JobSchedulerStore createJobSchedulerStore() throws IOException, UnsupportedOperationException
      Specified by:
      createJobSchedulerStore in interface org.apache.activemq.store.PersistenceAdapter
      Throws:
      IOException
      UnsupportedOperationException
    • isPersistNoLocal

      public boolean isPersistNoLocal()
      Specified by:
      isPersistNoLocal in interface org.apache.activemq.store.NoLocalSubscriptionAware