Class AbstractMessageStore

    • Constructor Detail

      • AbstractMessageStore

        public AbstractMessageStore​(QueueDefinition queueDef)
        Constructor
    • Method Detail

      • init

        public void init()
                  throws javax.jms.JMSException
        Description copied from interface: MessageStore
        Initialize the message store
        Specified by:
        init in interface MessageStore
        Throws:
        javax.jms.JMSException
      • getStoreUsage

        public final int getStoreUsage()
        Description copied from interface: MessageStore
        Get the store usage amount (%) (Ratio of used space over currently allocated space)
        Specified by:
        getStoreUsage in interface MessageStore
      • getAbsoluteStoreUsage

        public final int getAbsoluteStoreUsage()
        Description copied from interface: MessageStore
        Get the absolute store usage amount (%) (Ratio of used space over maximum allocatable space)
        Specified by:
        getAbsoluteStoreUsage in interface MessageStore
      • previous

        public final int previous​(int handle)
                           throws javax.jms.JMSException
        Description copied from interface: MessageStore
        Get the previous message handle after the given one
        Specified by:
        previous in interface MessageStore
        Parameters:
        handle - message handle
        Returns:
        the previous entry handle or -1 if their is no successor
        Throws:
        javax.jms.JMSException
      • delete

        public final void delete​(int handle)
                          throws javax.jms.JMSException
        Description copied from interface: MessageStore
        Delete message associated to the given handle from the store
        Specified by:
        delete in interface MessageStore
        Throws:
        javax.jms.JMSException - on storage error or invalid handle
      • first

        public final int first()
                        throws javax.jms.JMSException
        Description copied from interface: MessageStore
        Get the first message handle stored
        Specified by:
        first in interface MessageStore
        Returns:
        the first entry handle or -1 if the store is empty
        Throws:
        javax.jms.JMSException
      • next

        public final int next​(int handle)
                       throws javax.jms.JMSException
        Description copied from interface: MessageStore
        Get the next message handle after the given one
        Specified by:
        next in interface MessageStore
        Parameters:
        handle - block handle
        Returns:
        the next entry handle or -1 if their is no successor
        Throws:
        javax.jms.JMSException
      • size

        public final int size()
        Description copied from interface: MessageStore
        Get the number of messages in the store
        Specified by:
        size in interface MessageStore
      • commitChanges

        public final void commitChanges​(SynchronizationBarrier barrier)
                                 throws javax.jms.JMSException
        Description copied from interface: MessageStore
        Ensure everything is persisted (asynchronous)
        Specified by:
        commitChanges in interface MessageStore
        Throws:
        javax.jms.JMSException
      • commitChanges

        public final void commitChanges()
                                 throws javax.jms.JMSException
        Description copied from interface: MessageStore
        Ensure everything is persisted (synchronous)
        Specified by:
        commitChanges in interface MessageStore
        Throws:
        javax.jms.JMSException
      • close

        public final void close()
        Description copied from interface: MessageStore
        Close the store releasing associated system resources
        Specified by:
        close in interface MessageStore
      • retrieveMessage

        protected abstract AbstractMessage retrieveMessage​(int handle)
                                                    throws javax.jms.JMSException
        Retrieve the message with the given handle
        Throws:
        javax.jms.JMSException
      • retrieveMessagePriority

        protected abstract int retrieveMessagePriority​(int handle)
                                                throws javax.jms.JMSException
        Retrieve the priority of the message with the given handle
        Throws:
        javax.jms.JMSException
      • storeMessage

        protected abstract int storeMessage​(AbstractMessage message,
                                            int previousHandle)
                                     throws javax.jms.JMSException
        Store a message right after the given handle
        Throws:
        javax.jms.JMSException
      • retrieve

        public final AbstractMessage retrieve​(int handle)
                                       throws javax.jms.JMSException
        Description copied from interface: MessageStore
        Retrieve the message associated to a given handle
        Specified by:
        retrieve in interface MessageStore
        Throws:
        javax.jms.JMSException - on storage error or invalid handle
      • replace

        public final int replace​(int handle,
                                 AbstractMessage message)
                          throws javax.jms.JMSException
        Description copied from interface: MessageStore
        Replace a message in the store
        Specified by:
        replace in interface MessageStore
        Parameters:
        handle - message handle
        message - the message to store
        Throws:
        javax.jms.JMSException
      • replaceMessage

        protected abstract int replaceMessage​(int handle,
                                              AbstractMessage message)
                                       throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • store

        public final int store​(AbstractMessage message)
                        throws javax.jms.JMSException
        Description copied from interface: MessageStore
        Put some message under in the store after the last message with the same priority
        Specified by:
        store in interface MessageStore
        Parameters:
        message - the message to store
        Throws:
        javax.jms.JMSException
      • isLocked

        public final boolean isLocked​(int handle)
                               throws javax.jms.JMSException
        Description copied from interface: MessageStore
        Check if the message associated with a given handle is locked
        Specified by:
        isLocked in interface MessageStore
        Throws:
        javax.jms.JMSException - on storage error or invalid handle
      • lock

        public final void lock​(int handle)
                        throws javax.jms.JMSException
        Description copied from interface: MessageStore
        Lock the message associated to a given handle
        Specified by:
        lock in interface MessageStore
        Throws:
        javax.jms.JMSException - on storage error or invalid handle
      • unlock

        public final void unlock​(int handle)
                          throws javax.jms.JMSException
        Description copied from interface: MessageStore
        Unlock the message associated to a given handle
        Specified by:
        unlock in interface MessageStore
        Throws:
        javax.jms.JMSException - on storage error or invalid handle