org.jboss.seam.cron.spi.scheduling.trigger
Class TriggerSupport

java.lang.Object
  extended by org.jboss.seam.cron.spi.scheduling.trigger.TriggerSupport
Direct Known Subclasses:
ProviderContextTriggerSupport

public abstract class TriggerSupport
extends Object

Base class allowing scheduling providers to easily fire the appropriate CDI event when required. Simply provide the necessary objects (represented by #TriggerSupplies to the constructor when the schedule is first registered (see #CronSchedulingProvider). Then call #fireTrigger() at the scheduled time(s).

If the scheduling provider does not allow context to be passed directly to a new worker instance, but instead requires it to be passed via some other context, you will need to use #ProviderContextTriggerSupport instead.

Author:
Peter Royle
See Also:
ProviderContextTriggerSupport

Field Summary
protected  GregorianCalendar gc
           
protected  TriggerSupplies supplies
           
protected  int value
           
 
Constructor Summary
protected TriggerSupport()
           
  TriggerSupport(TriggerSupplies supplies)
           
 
Method Summary
protected  Trigger createHourEventPayload()
           
protected  Trigger createMinuteEventPayload()
           
protected  Trigger createScheduledEventPayload()
          Create an instance of the Event payload using the current system time.
protected  Trigger createSecondEventPayload()
           
 void fireTrigger()
          Fires the appropriate trigger payload with the appropriate qualifier (to in turn execute the application-specific code that observes those events).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

value

protected int value

gc

protected final GregorianCalendar gc

supplies

protected TriggerSupplies supplies
Constructor Detail

TriggerSupport

protected TriggerSupport()

TriggerSupport

public TriggerSupport(TriggerSupplies supplies)
Method Detail

fireTrigger

public void fireTrigger()
Fires the appropriate trigger payload with the appropriate qualifier (to in turn execute the application-specific code that observes those events).


createScheduledEventPayload

protected Trigger createScheduledEventPayload()
Create an instance of the Event payload using the current system time.

Returns:
an instance of Event.

createSecondEventPayload

protected Trigger createSecondEventPayload()

createMinuteEventPayload

protected Trigger createMinuteEventPayload()

createHourEventPayload

protected Trigger createHourEventPayload()


Copyright © 2011 Seam Framework. All Rights Reserved.