Class SchedulerQueue

  • All Implemented Interfaces:
    AgentMBean, Encodable, Serializable, DestinationMBean, QueueMBean

    public class SchedulerQueue
    extends Queue
    This class overrides the default Queue behavior in order to allow timed deliveries. When such a queue receives a message with a property called 'scheduleDate' then the message is not available for delivery before the specified date.
    See Also:
    Serialized Form
    • Constructor Detail

      • SchedulerQueue

        public SchedulerQueue()
    • Method Detail

      • initialize

        public void initialize​(boolean firstTime)
                        throws Exception
        Initializes the destination.
        Overrides:
        initialize in class Queue
        Parameters:
        firstTime - true when first called by the factory
        Throws:
        Exception
      • react

        public void react​(AgentId from,
                          Notification not)
                   throws Exception
        Description copied from class: Queue
        Distributes the received notifications to the appropriate reactions.
        Overrides:
        react in class Queue
        Parameters:
        from - agent sending notification
        not - notification to react to
        Throws:
        Exception - unspecialized exception
      • postProcess

        public void postProcess​(ClientMessages not)
        Description copied from class: Destination
        This method is needed to add processing after the standard handling. It is used in subclass of Queue and Topic. The incoming messages can be modified or deleted during the processing.
        Overrides:
        postProcess in class Destination
        Parameters:
        not - The incoming messages.
      • getScheduleDate

        private static long getScheduleDate​(Message msg)
      • checkDelivery

        protected boolean checkDelivery​(Message msg)
        Description copied from class: Queue
        Returns true if conditions are ok to deliver the message. This method must be overloaded in subclasses. Be careful only the message header is accessible.
        Overrides:
        checkDelivery in class Queue