org.oddjob.schedules.schedules
Class IntervalSchedule

java.lang.Object
  extended by org.oddjob.schedules.schedules.IntervalSchedule
All Implemented Interfaces:
Serializable, Schedule

public class IntervalSchedule
extends Object
implements Schedule, Serializable

Description

This schedule returns an interval from the given time to the interval time later.

This schedule is commonly used as a refinement of another schedule such as the DailySchedule, TimeSchedule or CountSchedule schedules.

Example

Every 20 minutes.
<schedules:interval interval="00:20" xmlns:schedules="http://rgordon.co.uk/oddjob/schedules"/>

Example

Examples Elsewhere.
See Also:
Serialized Form
Author:
Rob Gordon

Constructor Summary
IntervalSchedule()
          Default bean constructor.
IntervalSchedule(long millis)
          Constructor with milliseconds.
 
Method Summary
 ScheduleResult nextDue(ScheduleContext context)
          For a given date a schedule will provide the interval this schedule should next be scheduled in.
 void setInterval(String interval)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IntervalSchedule

public IntervalSchedule()
Default bean constructor.


IntervalSchedule

public IntervalSchedule(long millis)
Constructor with milliseconds.

Parameters:
millis -
Method Detail

setInterval

public void setInterval(String interval)
                 throws ParseException

Property: interval

Description: The interval time. The interval must be specified in one of the formats:

hh:mm
Hours and minutes.
hh:mm:ss
Hours, minutes and seconds.
hh.mm.ss.SSS
Hours, minutes, seconds and milliseconds.

Required: No but defaults to no interval.

Parameters:
interval - The interval.
Throws:
ParseException - If the interval is not a valid date.

nextDue

public ScheduleResult nextDue(ScheduleContext context)
Description copied from interface: Schedule
For a given date a schedule will provide the interval this schedule should next be scheduled in.

If the schedule is never due again for the given date, null is returned.

Specified by:
nextDue in interface Schedule
Returns:
The next due interval for the schedule.

toString

public String toString()
Overrides:
toString in class Object