Package org.knowm.sundial.plugins
Class AnnotationJobTriggerPlugin
java.lang.Object
org.knowm.sundial.plugins.AnnotationJobTriggerPlugin
- All Implemented Interfaces:
SchedulerPlugin
This plugin adds jobs and schedules them with triggers from annotated Job classes as the
scheduler is initialized.
- Author:
- timmolter
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuildCronTrigger
(CronTrigger cronTrigger, String jobName) buildSimpleTrigger
(SimpleTrigger simpleTrigger, String jobName) void
initialize
(String name, Scheduler scheduler) Called during creation of theScheduler
in order to give theSchedulerPlugin
a chance to initialize.void
shutdown()
Overridden to ignore wrapInUserTransaction because shutdown() does not interact with theScheduler
.void
start()
Called when the associatedScheduler
is started, in order to let the plug-in know it can now make calls into the scheduler if it needs to.
-
Constructor Details
-
AnnotationJobTriggerPlugin
Constructor- Parameters:
packageName
- A comma(,) or colon(:) can be used to specify multiple packages to scan for Jobs.
-
-
Method Details
-
initialize
Called during creation of theScheduler
in order to give theSchedulerPlugin
a chance to initialize.- Specified by:
initialize
in interfaceSchedulerPlugin
- Parameters:
name
- The name by which the plugin is identified.scheduler
- The scheduler to which the plugin is registered.- Throws:
SchedulerConfigException
- if there is an error initializing.SchedulerException
-
start
public void start()Description copied from interface:SchedulerPlugin
Called when the associatedScheduler
is started, in order to let the plug-in know it can now make calls into the scheduler if it needs to.- Specified by:
start
in interfaceSchedulerPlugin
-
buildCronTrigger
public OperableTrigger buildCronTrigger(CronTrigger cronTrigger, String jobName) throws ParseException - Throws:
ParseException
-
buildSimpleTrigger
-
shutdown
public void shutdown()Overridden to ignore wrapInUserTransaction because shutdown() does not interact with theScheduler
.- Specified by:
shutdown
in interfaceSchedulerPlugin
-