Bali Share 1.1.18

oracle.bali.share.thread
Class SchedulerEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--oracle.bali.share.thread.SchedulerEvent
All Implemented Interfaces:
java.io.Serializable

public class SchedulerEvent
extends java.util.EventObject

Events delivered by the TaskScheduler object. These events can be used to prevent tasks from being scheduled or delivered via the rejectTask() method.

See Also:
Serialized Form

Field Summary
static int TASK_RUNNING
          Event sent when a Task is about to be delivered.
static int TASK_SCHEDULED
          Event sent when a Task is scheduled.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
SchedulerEvent(java.lang.Object source, int id, Task task, long expectedTime)
          Creates a Scheduler event.
 
Method Summary
 long getExpectedTime()
          Returns the absolute time in milliseconds when the task expects to be run.
 int getID()
          Returns the ID of the event.
 Task getTask()
          Returns the task associated with this event.
 boolean isTaskRejected()
          Returns true if the task has been rejected.
 void rejectTask()
          Rejects the task, preventing it from either being scheduled or executed.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TASK_SCHEDULED

public static final int TASK_SCHEDULED
Event sent when a Task is scheduled.

TASK_RUNNING

public static final int TASK_RUNNING
Event sent when a Task is about to be delivered.
Constructor Detail

SchedulerEvent

public SchedulerEvent(java.lang.Object source,
                      int id,
                      Task task,
                      long expectedTime)
Creates a Scheduler event.
Parameters:
source - the scheduler on which task is being queued
id - the event id
task - the task being scheduled or delivered
expectedTime - the absolute time when the task expected to be delivered. This is the value computed by System.currentTimeMills()
Method Detail

getID

public int getID()
Returns the ID of the event.

rejectTask

public void rejectTask()
Rejects the task, preventing it from either being scheduled or executed.

isTaskRejected

public boolean isTaskRejected()
Returns true if the task has been rejected.

getTask

public Task getTask()
Returns the task associated with this event.

getExpectedTime

public long getExpectedTime()
Returns the absolute time in milliseconds when the task expects to be run.

Bali Share 1.1.18