com.silverpeas.scheduler
Class Job

java.lang.Object
  extended by com.silverpeas.scheduler.Job
Direct Known Subclasses:
ResizedImageCacheCleaner

public abstract class Job
extends Object

A job to schedule at a given moments in time. A job is identified in the scheduler by a name that must be unique.


Constructor Summary
Job(String name)
          Creates a new job with the specified name.
 
Method Summary
abstract  void execute(JobExecutionContext context)
          Executes the job with the specified execution context.
 String getName()
          Gets the name under which this job should be scheduled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Job

public Job(String name)
Creates a new job with the specified name.

Parameters:
name - the name under which the job has to be registered in the scheduler.
Method Detail

getName

public String getName()
Gets the name under which this job should be scheduled.

Returns:
the job name.

execute

public abstract 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.