com.silverpeas.scheduler.simple
Class SchedulerJob

java.lang.Object
  extended by com.silverpeas.scheduler.simple.SchedulerJob
All Implemented Interfaces:
ScheduledJob, Runnable
Direct Known Subclasses:
SchedulerEventJob, SchedulerMethodJob

Deprecated.

@Deprecated
public abstract class SchedulerJob
extends Object
implements Runnable, ScheduledJob

This is the base class of all scheduler job classes. This class is abstract. If you will implement your own special job class, you have to overrite the method 'execute' and add your own job generation method in the class 'SimpleScheduler'


Field Summary
protected  Format logDateFormat
          Deprecated.  
 
Constructor Summary
protected SchedulerJob(SimpleScheduler aController, SchedulerEventListener aOwner, String aJobName)
          Deprecated. The constructor has proteceted access, because the generation of jobs should be done in a central way by the class 'SimpleScheduler'
 
Method Summary
protected abstract  void execute(Date theExecutionDate)
          Deprecated. This method holds the logic of the job.
 void execute(JobExecutionContext context)
          Deprecated. Executes the job with the specified execution context.
 String getJobName()
          Deprecated. This method returns the name of the job
protected  long getMillisecondsOfCalendar(Calendar aCalendar)
          Deprecated. Wraps calender date access
 String getName()
          Deprecated. Gets the name under which the job is registered into the scheduler.
 long getNexExecutionTimeInMillis()
          Deprecated. Gets the next time in milliseconds at which the execution of this job will be fired.
 Date getNextExecutionTime()
          Deprecated. Gets the next time at which the execution of this job will be fired.
protected  long getNextTimeStamp()
          Deprecated. Generates a new timestamp
 SchedulerEventListener getOwner()
          Deprecated. This method returns the owner (or creator) of the job
 SchedulerEventListener getSchedulerEventListener()
          Deprecated. Gets the listener of the scheduler's events mapped with the state of this job execution.
 JobTrigger getTrigger()
          Deprecated. Gets the trigger responsible of firing the execution of this job.
 void initTimeStamp(long nextTime)
          Deprecated.  
 long readNextTimeStamp()
          Deprecated.  
 void run()
          Deprecated. This method handles the thread execution
protected  void setSchedulingParameter(CronJobTrigger trigger)
          Deprecated. This method sets the scheduling parameter.
protected  void setSchedulingParameter(List<Integer> startMinutes, List<Integer> startHours, List<Integer> startDaysOfMonth, List<Integer> startMonths, List<Integer> startDaysOfWeek)
          Deprecated. This method sets the scheduling parameter.
protected  void setTrigger(JobTrigger trigger)
          Deprecated.  
 void stop()
          Deprecated. Stops the scheduling of the job
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logDateFormat

protected Format logDateFormat
Deprecated. 
Constructor Detail

SchedulerJob

protected SchedulerJob(SimpleScheduler aController,
                       SchedulerEventListener aOwner,
                       String aJobName)
                throws SchedulerException
Deprecated. 
The constructor has proteceted access, because the generation of jobs should be done in a central way by the class 'SimpleScheduler'

Parameters:
aController - The controller, that controls all job executions
aOwner - The owner of the job
aJobName - The name of the job
aLogBaseFile - The log file for the job
Throws:
SchedulerException
Method Detail

getOwner

public SchedulerEventListener getOwner()
Deprecated. 
This method returns the owner (or creator) of the job

Returns:
The owner of the job

initTimeStamp

public void initTimeStamp(long nextTime)
Deprecated. 

readNextTimeStamp

public long readNextTimeStamp()
Deprecated. 

getNextExecutionTime

public Date getNextExecutionTime()
Deprecated. 
Description copied from interface: ScheduledJob
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.

Specified by:
getNextExecutionTime in interface ScheduledJob
Returns:
the next time at which this job should be executed.

getNexExecutionTimeInMillis

public long getNexExecutionTimeInMillis()
Deprecated. 
Description copied from interface: ScheduledJob
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.

Specified by:
getNexExecutionTimeInMillis in interface ScheduledJob
Returns:
the next time in milliseconds at which this job should be executed.

getJobName

public String getJobName()
Deprecated. 
This method returns the name of the job

Returns:
The name of the job

run

public void run()
Deprecated. 
This method handles the thread execution

Specified by:
run in interface Runnable

stop

public void stop()
Deprecated. 
Stops the scheduling of the job


execute

protected abstract void execute(Date theExecutionDate)
                         throws SchedulerException
Deprecated. 
This method holds the logic of the job. It has to be overwriten in subclasses of this class

Parameters:
log - A PrintStream for text writings in the log file for this job
theExecutionDate - The date of the execution
Throws:
SchedulerException

setSchedulingParameter

protected void setSchedulingParameter(List<Integer> startMinutes,
                                      List<Integer> startHours,
                                      List<Integer> startDaysOfMonth,
                                      List<Integer> startMonths,
                                      List<Integer> startDaysOfWeek)
                               throws SchedulerException
Deprecated. 
This method sets the scheduling parameter. The time settings are given by vectors. Each vector holds a list of Integer objects (currently ordered). Every Integer represents a element of a timestamp (cron like).

Parameters:
startMinutes - A list of minutes (0-59)
startHours - A list of hours (0-23)
startDaysOfMonth - A list of days of a month (1-31)
startMonths - A list of months (1-12; starts with 1 for January)
startDaysOfWeek - A list of day of a week (0-6; starts with 0 for Sunday)
Throws:
SchedulerException

setSchedulingParameter

protected void setSchedulingParameter(CronJobTrigger trigger)
                               throws SchedulerException
Deprecated. 
This method sets the scheduling parameter. It is given by a cron like string (currently ranges are not allowed). So the string '* 3,21 * 3 0' starts the execution every Sunday in March on 03:00 and 21:00. The allowed ranges are: minutes (0-59), hours (0-23), days of a month (1-31), months (1-12; starts with 1 for January), day of a week (0-6; starts with 0 for Sunday). Currently the parsing of the cron string ist not done by a state machine but by StringTokenizers so this method is very sensitive for syntax failures!

Parameters:
aCronString -
Throws:
SchedulerException

getNextTimeStamp

protected long getNextTimeStamp()
Deprecated. 
Generates a new timestamp

Returns:

getMillisecondsOfCalendar

protected long getMillisecondsOfCalendar(Calendar aCalendar)
Deprecated. 
Wraps calender date access

Parameters:
aCalendar -
Returns:

getName

public String getName()
Deprecated. 
Description copied from interface: ScheduledJob
Gets the name under which the job is registered into the scheduler.

Specified by:
getName in interface ScheduledJob
Returns:

execute

public void execute(JobExecutionContext context)
             throws Exception
Deprecated. 
Description copied from interface: ScheduledJob
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.

Specified by:
execute in interface ScheduledJob
Parameters:
context - the context under which this job is executed.
Throws:
Exception - if an error occurs during the job execution.

getSchedulerEventListener

public SchedulerEventListener getSchedulerEventListener()
Deprecated. 
Description copied from interface: ScheduledJob
Gets the listener of the scheduler's events mapped with the state of this job execution.

Specified by:
getSchedulerEventListener in interface ScheduledJob
Returns:
a scheduler's events listener registered with this job or null if no schedulers were defined with the job.

getTrigger

public JobTrigger getTrigger()
Deprecated. 
Description copied from interface: ScheduledJob
Gets the trigger responsible of firing the execution of this job.

Specified by:
getTrigger in interface ScheduledJob
Returns:
the trigger of this job.

setTrigger

protected void setTrigger(JobTrigger trigger)
Deprecated. 


Copyright © 2016 Silverpeas. All Rights Reserved.