com.scalagent.scheduler
Class ScheduleEvent

java.lang.Object
  extended by com.scalagent.scheduler.ScheduleEvent
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CronEvent

public class ScheduleEvent
extends java.lang.Object
implements java.io.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 Summary
protected  java.util.Date date
          event scheduling date
protected  java.lang.String name
          event name
protected  boolean outdatedRestart
          execute outdated event on restart
 
Constructor Summary
ScheduleEvent(java.lang.String name, java.util.Date date)
          Creates an item with a default value for outdatedRestart.
ScheduleEvent(java.lang.String name, java.util.Date date, boolean outdatedRestart)
          Creates an item.
 
Method Summary
protected  java.util.Date nextDate(java.util.Date now)
          Returns the next scheduling date after current date given as parameter.
 java.lang.String toString()
          Provides a string image for this object.
 java.lang.StringBuffer toString(java.lang.StringBuffer output)
          Provides a string image for this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
event name


date

protected java.util.Date date
event scheduling date


outdatedRestart

protected boolean outdatedRestart
execute outdated event on restart

Constructor Detail

ScheduleEvent

public ScheduleEvent(java.lang.String name,
                     java.util.Date date,
                     boolean outdatedRestart)
Creates an item.

Parameters:
name - event name
date - event scheduling date
outdatedRestart - execute outdated event on restart

ScheduleEvent

public ScheduleEvent(java.lang.String name,
                     java.util.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 java.lang.StringBuffer toString(java.lang.StringBuffer output)
Provides a string image for this object.

Returns:
a string image for this object

toString

public java.lang.String toString()
Provides a string image for this object.

Overrides:
toString in class java.lang.Object
Returns:
event string representation

nextDate

protected java.util.Date nextDate(java.util.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


Copyright © 2011 ScalAgent D.T.. All Rights Reserved.