Class LocalQueue

    • Constructor Detail

      • LocalQueue

        public LocalQueue​(FFMQEngine engine,
                          QueueDefinition queueDef)
                   throws javax.jms.JMSException
        Constructor
        Throws:
        javax.jms.JMSException
    • Method Detail

      • getDefinition

        public QueueDefinition getDefinition()
        Get the queue definition
      • getQueueName

        public String getQueueName()
        Specified by:
        getQueueName in interface javax.jms.Queue
      • unlockAndDeliver

        public void unlockAndDeliver​(MessageLock lockRef)
                              throws javax.jms.JMSException
        Unlock a message. Listeners are automatically notified of the new message availability.
        Throws:
        javax.jms.JMSException
      • removeLocked

        public void removeLocked​(MessageLock lockRef)
                          throws javax.jms.JMSException
        Remove a locked message from this queue. The message is deleted from the underlying store.
        Throws:
        javax.jms.JMSException
      • remove

        public boolean remove​(LocalSession localSession,
                              TransactionItem[] items)
                       throws javax.jms.JMSException
        Commit get operations on this queue (messages are removed)
        Returns:
        true if a store commit is required to ensure data safety
        Throws:
        javax.jms.JMSException
      • redeliverLocked

        public boolean redeliverLocked​(TransactionItem[] items,
                                       MessageLockSet locks)
                                throws javax.jms.JMSException
        Rollback get operations on this queue (messages are unlocked).. Consumers are notified of rollbacked messages availability
        Returns:
        true if a commit is required to ensure data safety
        Throws:
        javax.jms.JMSException
      • commitChanges

        public void commitChanges​(SynchronizationBarrier barrier)
                           throws javax.jms.JMSException
        Description copied from interface: Committable
        Commit all changes (make sure they are really applied) (ASYNCHRONOUS)
        Specified by:
        commitChanges in interface Committable
        Parameters:
        barrier - a synchronization barrier
        Throws:
        javax.jms.JMSException
      • get

        public AbstractMessage get​(LocalSession localSession,
                                   TransactionSet transactionSet,
                                   MessageSelector selector)
                            throws javax.jms.JMSException
        Get the first available message from this destination (matching an optional message selector). If a message is found, the transaction set is updated accordingly.
        Returns:
        a message or null if there is no available message (or queue is closed)
        Throws:
        javax.jms.JMSException
      • browse

        public AbstractMessage browse​(LocalQueueBrowserCursor cursor,
                                      MessageSelector selector)
                               throws javax.jms.JMSException
        Browse a message in this queue
        Parameters:
        cursor - browser cursor
        selector - a message selector or null
        Returns:
        a matching message or null
        Throws:
        javax.jms.JMSException - on internal error
      • purge

        public void purge​(MessageSelector selector)
                   throws javax.jms.JMSException
        Purge some messages from the buffer
        Throws:
        javax.jms.JMSException
      • toString

        public String toString()
        Specified by:
        toString in interface javax.jms.Queue
        Overrides:
        toString in class Object
      • getSentToQueueCount

        public long getSentToQueueCount()
        Description copied from interface: LocalQueueMBean
        Get the number of messages sent to this queue (since startup or last reset)
        Specified by:
        getSentToQueueCount in interface LocalQueueMBean
      • getAcknowledgedGetCount

        public long getAcknowledgedGetCount()
        Description copied from interface: LocalQueueMBean
        Get the number of acknowledged get operations on this queue (since startup or last reset)
        Specified by:
        getAcknowledgedGetCount in interface LocalQueueMBean
      • getRollbackedGetCount

        public long getRollbackedGetCount()
        Description copied from interface: LocalQueueMBean
        Get the number of rollbacked get operations on this queue (since startup or last reset)
        Specified by:
        getRollbackedGetCount in interface LocalQueueMBean
      • getExpiredCount

        public long getExpiredCount()
        Description copied from interface: LocalQueueMBean
        Get the number of messages that were removed from this queue because they expired (since startup or last reset)
        Specified by:
        getExpiredCount in interface LocalQueueMBean
      • getStoreFullEventsCount

        public long getStoreFullEventsCount()
        Description copied from interface: LocalQueueMBean
        Get the number of times a message could not be stored because the queue store was full
        Specified by:
        getStoreFullEventsCount in interface LocalQueueMBean
      • getLastActivity

        public long getLastActivity()
        Description copied from interface: ActiveObject
        Get a timestamp of this object's last activity
        Specified by:
        getLastActivity in interface ActiveObject
        Returns:
        a java timestamp
      • getTimeoutDelay

        public long getTimeoutDelay()
        Description copied from interface: ActiveObject
        Get the maximum allowed time between activities
        Specified by:
        getTimeoutDelay in interface ActiveObject
        Returns:
        a delay in milliseconds
      • onActivityTimeout

        public boolean onActivityTimeout()
                                  throws Exception
        Description copied from interface: ActiveObject
        Called if the object has been inactive for more
        Specified by:
        onActivityTimeout in interface ActiveObject
        Returns:
        true if the object should be unregistered immediately upon return
        Throws:
        Exception
      • processAvailabilityNotificationQueue

        protected void processAvailabilityNotificationQueue()