2016/02/07 - Apache Onami has been retired.

For more information, please explore the Attic.

public abstract class

QuartzModule

extends AbstractModule
java.lang.Object
   ↳ com.google.inject.AbstractModule
     ↳ org.apache.onami.scheduler.QuartzModule

Class Overview

Quartz (http://www.quartz-scheduler.org/) Module as Google-Guice extension.

Summary

Public Constructors
QuartzModule()
Protected Methods
final void addJobListener(Class<? extends JobListener> jobListenerType)
Add the JobListener binding.
final void addSchedulerListener(Class<? extends SchedulerListener> schedulerListenerType)
Add the SchedulerListener binding.
final void addTriggerListener(Class<? extends TriggerListener> triggerListenerType)
Add the TriggerListener binding.
final void configure()
final SchedulerConfigurationBuilder configureScheduler()
Allows to configure the scheduler.
final <T> void doBind(Multibinder<T> binder, Class<? extends T> type)
Utility method to respect the DRY principle.
abstract void schedule()
Part of the EDSL builder language for configuring Jobs.
final JobSchedulerBuilder scheduleJob(Class<? extends Job> jobClass)
Allows Job scheduling, delegating Guice create the Job instance and inject members.
[Expand]
Inherited Methods
From class com.google.inject.AbstractModule
From class java.lang.Object
From interface com.google.inject.Module

Public Constructors

public QuartzModule ()

Protected Methods

protected final void addJobListener (Class<? extends JobListener> jobListenerType)

Add the JobListener binding.

Parameters
jobListenerType The JobListener class has to be bound

protected final void addSchedulerListener (Class<? extends SchedulerListener> schedulerListenerType)

Add the SchedulerListener binding.

Parameters
schedulerListenerType The SchedulerListener class has to be bound

protected final void addTriggerListener (Class<? extends TriggerListener> triggerListenerType)

Add the TriggerListener binding.

Parameters
triggerListenerType The TriggerListener class has to be bound

protected final void configure ()

protected final SchedulerConfigurationBuilder configureScheduler ()

Allows to configure the scheduler.

 Guice.createInjector(..., new QuartzModule() {

     @Override
     protected void schedule() {
       configureScheduler().withManualStart().withProperties(...);
     }

 });
 

protected final void doBind (Multibinder<T> binder, Class<? extends T> type)

Utility method to respect the DRY principle.

protected abstract void schedule ()

Part of the EDSL builder language for configuring Jobs. Here is a typical example of scheduling Jobs when creating your Guice injector:

 Guice.createInjector(..., new QuartzModule() {

     @Override
     protected void schedule() {
       scheduleJob(MyJobImpl.class).withCronExpression("0/2 * * * * ?");
     }

 });
 

protected final JobSchedulerBuilder scheduleJob (Class<? extends Job> jobClass)

Allows Job scheduling, delegating Guice create the Job instance and inject members. If given Job class is annotated with Scheduled, then Job and related Trigger values will be extracted from it.

Parameters
jobClass The Job has to be scheduled
Returns
  • The Job builder