com.silverpeas.scheduler.trigger
Class JobTriggerFactory

java.lang.Object
  extended by com.silverpeas.scheduler.trigger.JobTriggerFactory

public class JobTriggerFactory
extends Object

A factory of job triggers. This factory creates the specific job triggers depending upons the scheduling parameters.


Method Summary
static JobTriggerFactory getFactory()
          Gets a factory of a job trigger.
 CronJobTrigger getJobTriggerWithCronExpression(String cron)
          Creates a new job trigger that will fire a job exectution at given moments in the time, as defined by the specified cron expression.
 FixedPeriodJobTrigger getJobTriggerWithPeriodicity(int time, TimeUnit unit)
          Creates a new job trigger that will fire a job execution at the specified regular time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFactory

public static JobTriggerFactory getFactory()
Gets a factory of a job trigger.

Returns:
a JobTriggerFactory instance.

getJobTriggerWithPeriodicity

public FixedPeriodJobTrigger getJobTriggerWithPeriodicity(int time,
                                                          TimeUnit unit)
Creates a new job trigger that will fire a job execution at the specified regular time.

Parameters:
time - the time between each job triggering.
unit - the unit in which the time is expressed.
Returns:
a job trigger whose type depends upon the specified periodicity.

getJobTriggerWithCronExpression

public CronJobTrigger getJobTriggerWithCronExpression(String cron)
                                               throws ParseException
Creates a new job trigger that will fire a job exectution at given moments in the time, as defined by the specified cron expression.

Parameters:
cron - the Unix cron-like expression.
Returns:
a SimpleCronJobTrigger instance.
Throws:
ParseException - if the specified cron expression is not valid.
See Also:
SimpleCronJobTrigger


Copyright © 2016 Silverpeas. All Rights Reserved.