Class ScheduleEvent

  • All Implemented Interfaces:
    Serializable
    Direct Known Subclasses:
    CronEvent

    public class ScheduleEvent
    extends Object
    implements Serializable
    Base class for event requesting a scheduling to a Scheduler.

    The base class implements a one shot scheduling. This is true as long as the Scheduler is active at (about) the scheduling date and time. If it was down at that time, the outdated event is triggered only if its outdatedRestart field is true.

    This class is also used by the Scheduler to keep the request until it is complete.

    See Also:
    Scheduler, Serialized Form
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        define serialVersionUID for interoperability
        See Also:
        Constant Field Values
      • name

        protected String name
        event name
      • date

        protected Date date
        event scheduling date
      • outdatedRestart

        protected boolean outdatedRestart
        execute outdated event on restart
    • Constructor Detail

      • ScheduleEvent

        public ScheduleEvent​(String name,
                             Date date,
                             boolean outdatedRestart)
        Creates an item.
        Parameters:
        name - event name
        date - event scheduling date
        outdatedRestart - execute outdated event on restart
      • ScheduleEvent

        public ScheduleEvent​(String name,
                             Date date)
        Creates an item with a default value for outdatedRestart.

        outdatedRestart is given a true value when

        Parameters:
        name - event name
        date - event scheduling date
    • Method Detail

      • toString

        public StringBuffer toString​(StringBuffer output)
        Provides a string image for this object.
        Returns:
        a string image for this object
      • toString

        public String toString()
        Provides a string image for this object.
        Overrides:
        toString in class Object
        Returns:
        event string representation
      • nextDate

        protected Date nextDate​(Date now)
        Returns the next scheduling date after current date given as parameter. The new date must be strictly greater than the current date. A null date leads to the scheduler deleting the event.

        This function should be overloaded in derived classes to actually implement recurrent scheduling.

        Parameters:
        now - current date
        Returns:
        next scheduling date after now