com.silverpeas.scheduler
Interface ScheduledJob

All Known Implementing Classes:
QuartzSchedulerJob, SchedulerEventJob, SchedulerEventJobMinute, SchedulerJob, SchedulerMethodJob, SchedulerMethodJobMinute

public interface ScheduledJob

A job that is scheduled in the scheduler. A job registered in the scheduler is instanciated into a ScheduledJob object that carries all of the information required by the scheduler to perform its task. The implementation of this interface depends upon the scheduling backend in use.


Method Summary
 void execute(JobExecutionContext context)
          Executes the job with the specified execution context.
 String getName()
          Gets the name under which the job is registered into the scheduler.
 long getNexExecutionTimeInMillis()
          Gets the next time in milliseconds at which the execution of this job will be fired.
 Date getNextExecutionTime()
          Gets the next time at which the execution of this job will be fired.
 SchedulerEventListener getSchedulerEventListener()
          Gets the listener of the scheduler's events mapped with the state of this job execution.
 JobTrigger getTrigger()
          Gets the trigger responsible of firing the execution of this job.
 

Method Detail

getName

String getName()
Gets the name under which the job is registered into the scheduler.

Returns:

getNextExecutionTime

Date getNextExecutionTime()
Gets the next time at which the execution of this job will be fired. The next execution time depends upon the trigger with which it is registered in the scheduler.

Returns:
the next time at which this job should be executed.

getNexExecutionTimeInMillis

long getNexExecutionTimeInMillis()
Gets the next time in milliseconds at which the execution of this job will be fired. The next execution time depends upon the trigger with which it is registered in the scheduler.

Returns:
the next time in milliseconds at which this job should be executed.

getTrigger

JobTrigger getTrigger()
Gets the trigger responsible of firing the execution of this job.

Returns:
the trigger of this job.

getSchedulerEventListener

SchedulerEventListener getSchedulerEventListener()
Gets the listener of the scheduler's events mapped with the state of this job execution.

Returns:
a scheduler's events listener registered with this job or null if no schedulers were defined with the job.

execute

void execute(JobExecutionContext context)
             throws Exception
Executes the job with the specified execution context. The context carries the information that can be required by the job to fulfill its execution, like the job parameters.

Parameters:
context - the context under which this job is executed.
Throws:
Exception - if an error occurs during the job execution.


Copyright © 2016 Silverpeas. All Rights Reserved.