org.jppf.scheduling
Class JPPFScheduleHandler

java.lang.Object
  extended by org.jppf.scheduling.JPPFScheduleHandler

public class JPPFScheduleHandler
extends Object

This class handles a timer.

Author:
Laurent Cohen

Nested Class Summary
 class JPPFScheduleHandler.ScheduleHandlerTask
          Timer task that triggers an action when the corresponding schedule date is reached.
 
Constructor Summary
JPPFScheduleHandler()
          Initialize this schedule handler with a default name.
JPPFScheduleHandler(String name)
          Initialize this schedule handler with the specified name.
 
Method Summary
 void cancelAction(Object key)
          Cancel the scheduled action identified by the specified key.
 void clear()
          Cleanup this schedule handler.
 void clear(boolean shutdown)
          Shutdown this schedule handler.
 void scheduleAction(Object key, JPPFSchedule schedule, Runnable action)
          Schedule an action.
 void scheduleAction(Object key, JPPFSchedule schedule, Runnable action, long start)
          Schedule an action.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JPPFScheduleHandler

public JPPFScheduleHandler()
Initialize this schedule handler with a default name.


JPPFScheduleHandler

public JPPFScheduleHandler(String name)
Initialize this schedule handler with the specified name.

Parameters:
name - the name given to this schedule handler.
Method Detail

scheduleAction

public void scheduleAction(Object key,
                           JPPFSchedule schedule,
                           Runnable action)
                    throws ParseException
Schedule an action.

Parameters:
key - key used to retrieve or cancel the action at a later time.
schedule - the schedule at which the action is triggered.
action - the action to perform when the schedule date is reached.
Throws:
ParseException - if the schedule date could not be parsed

scheduleAction

public void scheduleAction(Object key,
                           JPPFSchedule schedule,
                           Runnable action,
                           long start)
                    throws ParseException
Schedule an action.

Parameters:
key - key used to retrieve or cancel the action at a later time.
schedule - the schedule at which the action is triggered.
action - the action to perform when the schedule date is reached.
start - the start time to use if the schedule is expressed as a durartion.
Throws:
ParseException - if the schedule date could not be parsed

cancelAction

public void cancelAction(Object key)
Cancel the scheduled action identified by the specified key.

Parameters:
key - the key associated with the action.

clear

public void clear()
Cleanup this schedule handler.


clear

public void clear(boolean shutdown)
Shutdown this schedule handler.

Parameters:
shutdown - flag indicating whether this scehdule handler should be shutdown.


Copyright © 2005-2010 JPPF Team.