com.silverpeas.scheduler
Class SchedulerEvent

java.lang.Object
  extended by com.silverpeas.scheduler.SchedulerEvent

public class SchedulerEvent
extends Object

A scheduler event represents an event that is generated within the scheduling system and that is dispatched by schedulers to registered event listeners. A scheduler event is generated each time a state change occurs in the scheduling system machinery and the event carries information about this state change. A state change occurs in the scheduling system in the following situation:


Nested Class Summary
static class SchedulerEvent.Type
          The different possible types of an event send by the scheduler.
 
Constructor Summary
protected SchedulerEvent(SchedulerEvent.Type aType, JobExecutionContext aContext)
          Constructs a scheduler event.
 
Method Summary
 JobExecutionContext getJobExecutionContext()
          Gets the context of a job execution.
 Throwable getJobThrowable()
          Gets the throwable object that was thrown during a job execution and that carries the job failure.
 SchedulerEvent.Type getType()
          This method returns the event type
 boolean isExceptionThrown()
          Is an exception thrown during a job execution?
static SchedulerEvent jobFailed(JobExecutionContext context, Throwable throwable)
          Creates a new scheduler event about a failure of a job execution.
static SchedulerEvent jobSucceeded(JobExecutionContext context)
          Creates a new scheduler event about a success of a job execution.
protected  void setThrowable(Throwable aThrowable)
           
static SchedulerEvent triggerFired(JobExecutionContext context)
          Creates a new scheduler event about a trigger firing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchedulerEvent

protected SchedulerEvent(SchedulerEvent.Type aType,
                         JobExecutionContext aContext)
Constructs a scheduler event.

Parameters:
aType - The type of the event
aJob - The job, which is the source for the event
Method Detail

triggerFired

public static SchedulerEvent triggerFired(JobExecutionContext context)
Creates a new scheduler event about a trigger firing.

Parameters:
the - context of the job to be executed.
Returns:
the scheduler event fired by the firing of a trigger.

jobSucceeded

public static SchedulerEvent jobSucceeded(JobExecutionContext context)
Creates a new scheduler event about a success of a job execution.

Parameters:
the - context of the completed execution of a job.
Returns:
the scheduler event fired by the job completion.

jobFailed

public static SchedulerEvent jobFailed(JobExecutionContext context,
                                       Throwable throwable)
Creates a new scheduler event about a failure of a job execution.

Parameters:
context - the context of the failed execution of a job.
throwable - the Throwable object carrying the job failure.
Returns:
the scheduler event fired by a job failure.

getType

public SchedulerEvent.Type getType()
This method returns the event type

Returns:
The type of the event

isExceptionThrown

public boolean isExceptionThrown()
Is an exception thrown during a job execution?

Returns:
true if an exception was thrown during the execution of a job, false otherwise.

getJobThrowable

public Throwable getJobThrowable()
Gets the throwable object that was thrown during a job execution and that carries the job failure.

Returns:
the throwable raised during a job execution or null if the job completed successfully.

getJobExecutionContext

public JobExecutionContext getJobExecutionContext()
Gets the context of a job execution.

Returns:
a JobExecutionContext instance as it is or it will passed to a job execution.

setThrowable

protected void setThrowable(Throwable aThrowable)


Copyright © 2016 Silverpeas. All Rights Reserved.