Class JournalPersistenceAdapter

  • All Implemented Interfaces:
    org.apache.activeio.journal.JournalEventListener, BrokerServiceAware, org.apache.activemq.Service, PersistenceAdapter, UsageListener

    @Deprecated(forRemoval=true)
    public class JournalPersistenceAdapter
    extends Object
    implements PersistenceAdapter, org.apache.activeio.journal.JournalEventListener, UsageListener, BrokerServiceAware
    Deprecated, for removal: This API element is subject to removal in a future version.
    - Deprecated for removal as this PersistenceAdapter is no longer used and replaced by the JDBCPersistenceAdapter.
    An implementation of PersistenceAdapter designed for use with a Journal and then check pointing asynchronously on a timeout with some other long term persistent storage.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.apache.activemq.thread.Scheduler scheduler
      Deprecated, for removal: This API element is subject to removal in a future version.
       
    • Constructor Summary

      Constructors 
      Constructor Description
      JournalPersistenceAdapter()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      JournalPersistenceAdapter​(org.apache.activeio.journal.Journal journal, PersistenceAdapter longTermPersistence, org.apache.activemq.thread.TaskRunnerFactory taskRunnerFactory)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void allowIOResumption()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      void beginTransaction​(ConnectionContext context)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      void checkpoint​(boolean sync)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      void checkpoint​(boolean sync, boolean fullCheckpoint)
      Deprecated, for removal: This API element is subject to removal in a future version.
      When we checkpoint we move all the journalled data to long term storage.
      void commitTransaction​(ConnectionContext context)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      JobSchedulerStore createJobSchedulerStore()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      MessageStore createQueueMessageStore​(org.apache.activemq.command.ActiveMQQueue destination)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      protected IOException createRecoveryFailedException​(Exception e)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      TopicMessageStore createTopicMessageStore​(org.apache.activemq.command.ActiveMQTopic destinationName)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      TransactionStore createTransactionStore()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      protected IOException createWriteException​(String command, Exception e)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      protected IOException createWriteException​(org.apache.activemq.command.DataStructure packet, Exception e)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      void deleteAllMessages()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      boolean doCheckpoint()
      Deprecated, for removal: This API element is subject to removal in a future version.
      This does the actual checkpoint.
      long getCheckpointInterval()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      Set<org.apache.activemq.command.ActiveMQDestination> getDestinations()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      File getDirectory()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      long getLastMessageBrokerSequenceId()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      long getLastProducerSequenceId​(org.apache.activemq.command.ProducerId id)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      PersistenceAdapter getLongTermPersistence()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      int getMaxCheckpointMessageAddSize()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      int getMaxCheckpointWorkers()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      JournalTransactionStore getTransactionStore()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      SystemUsage getUsageManager()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      org.apache.activemq.wireformat.WireFormat getWireFormat()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      boolean isUseExternalMessageReferences()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      void onUsageChanged​(Usage usage, int oldPercentUsage, int newPercentUsage)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      void overflowNotification​(org.apache.activeio.journal.RecordLocation safeLocation)
      Deprecated, for removal: This API element is subject to removal in a future version.
      The Journal give us a call back so that we can move old data out of the journal.
      org.apache.activemq.command.DataStructure readCommand​(org.apache.activeio.journal.RecordLocation location)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      void removeQueueMessageStore​(org.apache.activemq.command.ActiveMQQueue destination)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Cleanup method to remove any state associated with the given destination
      void removeTopicMessageStore​(org.apache.activemq.command.ActiveMQTopic destination)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Cleanup method to remove any state associated with the given destination
      void rollbackTransaction​(ConnectionContext context)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      void setBrokerName​(String brokerName)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      void setBrokerService​(BrokerService brokerService)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      void setCheckpointInterval​(long checkpointInterval)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      void setDirectory​(File dir)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      void setJournal​(org.apache.activeio.journal.Journal journal)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      void setMaxCheckpointMessageAddSize​(int maxCheckpointMessageAddSize)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      void setMaxCheckpointWorkers​(int maxCheckpointWorkers)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      void setPersistenceAdapter​(PersistenceAdapter longTermPersistence)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      void setTaskRunnerFactory​(org.apache.activemq.thread.TaskRunnerFactory taskRunnerFactory)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      void setUsageManager​(SystemUsage usageManager)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      void setUseExternalMessageReferences​(boolean enable)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      long size()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      void start()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      void stop()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      ByteSequence toByteSequence​(org.apache.activeio.packet.Packet packet)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      org.apache.activeio.packet.Packet toPacket​(ByteSequence sequence)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      String toString()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      org.apache.activeio.journal.RecordLocation writeCommand​(org.apache.activemq.command.DataStructure command, boolean sync)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
    • Field Detail

      • scheduler

        protected org.apache.activemq.thread.Scheduler scheduler
        Deprecated, for removal: This API element is subject to removal in a future version.
    • Constructor Detail

      • JournalPersistenceAdapter

        public JournalPersistenceAdapter()
        Deprecated, for removal: This API element is subject to removal in a future version.
      • JournalPersistenceAdapter

        public JournalPersistenceAdapter​(org.apache.activeio.journal.Journal journal,
                                         PersistenceAdapter longTermPersistence,
                                         org.apache.activemq.thread.TaskRunnerFactory taskRunnerFactory)
                                  throws IOException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Throws:
        IOException
    • Method Detail

      • setTaskRunnerFactory

        public void setTaskRunnerFactory​(org.apache.activemq.thread.TaskRunnerFactory taskRunnerFactory)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • setJournal

        public void setJournal​(org.apache.activeio.journal.Journal journal)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • setPersistenceAdapter

        public void setPersistenceAdapter​(PersistenceAdapter longTermPersistence)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • setUsageManager

        public void setUsageManager​(SystemUsage usageManager)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        setUsageManager in interface PersistenceAdapter
        Parameters:
        usageManager - The UsageManager that is controlling the destination's memory usage.
      • getDestinations

        public Set<org.apache.activemq.command.ActiveMQDestination> getDestinations()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        getDestinations in interface PersistenceAdapter
      • removeQueueMessageStore

        public void removeQueueMessageStore​(org.apache.activemq.command.ActiveMQQueue destination)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Cleanup method to remove any state associated with the given destination
        Specified by:
        removeQueueMessageStore in interface PersistenceAdapter
        Parameters:
        destination - Destination to forget
      • removeTopicMessageStore

        public void removeTopicMessageStore​(org.apache.activemq.command.ActiveMQTopic destination)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Cleanup method to remove any state associated with the given destination
        Specified by:
        removeTopicMessageStore in interface PersistenceAdapter
        Parameters:
        destination - Destination to forget
      • start

        public void start()
                   throws Exception
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        start in interface org.apache.activemq.Service
        Throws:
        Exception
      • stop

        public void stop()
                  throws Exception
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        stop in interface org.apache.activemq.Service
        Throws:
        Exception
      • getLongTermPersistence

        public PersistenceAdapter getLongTermPersistence()
        Deprecated, for removal: This API element is subject to removal in a future version.
      • getWireFormat

        public org.apache.activemq.wireformat.WireFormat getWireFormat()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Returns:
        Returns the wireFormat.
      • overflowNotification

        public void overflowNotification​(org.apache.activeio.journal.RecordLocation safeLocation)
        Deprecated, for removal: This API element is subject to removal in a future version.
        The Journal give us a call back so that we can move old data out of the journal. Taking a checkpoint does this for us.
        Specified by:
        overflowNotification in interface org.apache.activeio.journal.JournalEventListener
        See Also:
        org.apache.activemq.journal.JournalEventListener#overflowNotification(org.apache.activemq.journal.RecordLocation)
      • checkpoint

        public void checkpoint​(boolean sync,
                               boolean fullCheckpoint)
        Deprecated, for removal: This API element is subject to removal in a future version.
        When we checkpoint we move all the journalled data to long term storage.
      • checkpoint

        public void checkpoint​(boolean sync)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        checkpoint in interface PersistenceAdapter
      • doCheckpoint

        public boolean doCheckpoint()
        Deprecated, for removal: This API element is subject to removal in a future version.
        This does the actual checkpoint.
        Returns:
      • readCommand

        public org.apache.activemq.command.DataStructure readCommand​(org.apache.activeio.journal.RecordLocation location)
                                                              throws IOException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Parameters:
        location -
        Returns:
        Throws:
        IOException
      • createWriteException

        protected IOException createWriteException​(org.apache.activemq.command.DataStructure packet,
                                                   Exception e)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • createWriteException

        protected IOException createWriteException​(String command,
                                                   Exception e)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • createRecoveryFailedException

        protected IOException createRecoveryFailedException​(Exception e)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • writeCommand

        public org.apache.activeio.journal.RecordLocation writeCommand​(org.apache.activemq.command.DataStructure command,
                                                                       boolean sync)
                                                                throws IOException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Parameters:
        command -
        sync -
        Returns:
        Throws:
        IOException
      • onUsageChanged

        public void onUsageChanged​(Usage usage,
                                   int oldPercentUsage,
                                   int newPercentUsage)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        onUsageChanged in interface UsageListener
      • getTransactionStore

        public JournalTransactionStore getTransactionStore()
        Deprecated, for removal: This API element is subject to removal in a future version.
      • getUsageManager

        public SystemUsage getUsageManager()
        Deprecated, for removal: This API element is subject to removal in a future version.
      • getMaxCheckpointMessageAddSize

        public int getMaxCheckpointMessageAddSize()
        Deprecated, for removal: This API element is subject to removal in a future version.
      • setMaxCheckpointMessageAddSize

        public void setMaxCheckpointMessageAddSize​(int maxCheckpointMessageAddSize)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • getMaxCheckpointWorkers

        public int getMaxCheckpointWorkers()
        Deprecated, for removal: This API element is subject to removal in a future version.
      • setMaxCheckpointWorkers

        public void setMaxCheckpointWorkers​(int maxCheckpointWorkers)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • getCheckpointInterval

        public long getCheckpointInterval()
        Deprecated, for removal: This API element is subject to removal in a future version.
      • setCheckpointInterval

        public void setCheckpointInterval​(long checkpointInterval)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • isUseExternalMessageReferences

        public boolean isUseExternalMessageReferences()
        Deprecated, for removal: This API element is subject to removal in a future version.
      • setUseExternalMessageReferences

        public void setUseExternalMessageReferences​(boolean enable)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • toPacket

        public org.apache.activeio.packet.Packet toPacket​(ByteSequence sequence)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • toByteSequence

        public ByteSequence toByteSequence​(org.apache.activeio.packet.Packet packet)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • setBrokerName

        public void setBrokerName​(String brokerName)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        setBrokerName in interface PersistenceAdapter
      • toString

        public String toString()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Overrides:
        toString in class Object
      • setDirectory

        public void setDirectory​(File dir)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        setDirectory in interface PersistenceAdapter
      • getDirectory

        public File getDirectory()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        getDirectory in interface PersistenceAdapter
      • size

        public long size()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        size in interface PersistenceAdapter
      • getLastProducerSequenceId

        public long getLastProducerSequenceId​(org.apache.activemq.command.ProducerId id)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        getLastProducerSequenceId in interface PersistenceAdapter
      • allowIOResumption

        public void allowIOResumption()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        allowIOResumption in interface PersistenceAdapter