org.qi4j.library.scheduler.bootstrap
Class SchedulerAssembler

java.lang.Object
  extended by org.qi4j.library.scheduler.bootstrap.SchedulerAssembler
All Implemented Interfaces:
Assembler

public class SchedulerAssembler
extends Object
implements Assembler

Assembler for Scheduler. Use this Assembler to add the Scheduler service to your application. This Assembler provide a fluent api to programmatically configure configuration defaults and activate the Timeline service assembly that allow to browse in past and future Task runs. Here is a full example:

      new SchedulerAssembler().
              visibleIn( Visibility.layer ).
              withConfigAssembly( configModuleAssembly ).
              withPulseRhythm( 60 ).
              withGarbageCollectorRhythm( 600 ).
              withTimeline().
              assemble( module );
 


Constructor Summary
SchedulerAssembler()
           
 
Method Summary
 void assemble(ModuleAssembly assembly)
          Assemblers receive a callback to the ModuleAssembly they are supposed to configure.
 SchedulerAssembler visibleIn(Visibility visibility)
           
 SchedulerAssembler withConfigAssembly(ModuleAssembly configAssembly)
          Set the ModuleAssembly to use for Configuration entities.
 SchedulerAssembler withGarbageCollectorRhythm(Integer garbageCollectorRhythm)
          Set the garbage collector rhythm.
 SchedulerAssembler withPulseRhythm(Integer pulseRhythm)
          Set the pulse rhythm.
 SchedulerAssembler withTimeline()
          Activate the assembly of Timeline related services.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchedulerAssembler

public SchedulerAssembler()
Method Detail

visibleIn

public SchedulerAssembler visibleIn(Visibility visibility)

withConfigAssembly

public SchedulerAssembler withConfigAssembly(ModuleAssembly configAssembly)
Set the ModuleAssembly to use for Configuration entities.

Parameters:
configAssembly - ModuleAssembly to use for Configuration entities
Returns:
SchedulerAssembler

withPulseRhythm

public SchedulerAssembler withPulseRhythm(Integer pulseRhythm)
Set the pulse rhythm.

Parameters:
pulseRhythm - Scheduler pulse rhythm in seconds
Returns:
SchedulerAssembler

withGarbageCollectorRhythm

public SchedulerAssembler withGarbageCollectorRhythm(Integer garbageCollectorRhythm)
Set the garbage collector rhythm.

Parameters:
garbageCollectorRhythm - Scheduler garbage collector rhythm in seconds
Returns:
SchedulerAssembler

withTimeline

public SchedulerAssembler withTimeline()
Activate the assembly of Timeline related services.

Returns:
SchedulerAssembler

assemble

public void assemble(ModuleAssembly assembly)
              throws AssemblyException
Description copied from interface: Assembler
Assemblers receive a callback to the ModuleAssembly they are supposed to configure. They can use this to register objects, composites, services etc. and the additional metadata that may exist for these artifacts.

An Assembler may create new Modules by calling ModuleAssembly.layer() and then LayerAssembly.module(String) (String)}. This allows an Assembler to bootstrap an entire Layer with more Modules.

Specified by:
assemble in interface Assembler
Parameters:
assembly - the Module to assemble
Throws:
AssemblyException - thrown if the assembler tries to do something illegal