org.jboss.seam.async
Class AbstractDispatcher<T,S extends Schedule>

java.lang.Object
  extended by org.jboss.seam.async.AbstractDispatcher<T,S>
All Implemented Interfaces:
Dispatcher<T,S>
Direct Known Subclasses:
QuartzDispatcher, ThreadPoolDispatcher, TimerServiceDispatcher

public abstract class AbstractDispatcher<T,S extends Schedule>
extends Object
implements Dispatcher<T,S>

Abstract Dispatcher implementation

Author:
Gavin King

Nested Class Summary
 class AbstractDispatcher.DispatcherParameters
           
 
Field Summary
static String EXECUTING_ASYNCHRONOUS_CALL
           
 
Constructor Summary
AbstractDispatcher()
           
 
Method Summary
protected  Schedule createSchedule(InvocationContext invocation)
           
protected  TimerSchedule createTimerSchedule(InvocationContext invocation)
           
protected  AbstractDispatcher.DispatcherParameters extractAndValidateParameters(InvocationContext invocation)
           
static Dispatcher instance()
           
 void scheduleTransactionCompletionEvent(String type, Object... parameters)
          Schedule an event to be processed when the current transaction ends
 void scheduleTransactionSuccessEvent(String type, Object... parameters)
          Schedule an event to be processed if and when the current transaction completes successfully
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.seam.async.Dispatcher
scheduleAsynchronousEvent, scheduleInvocation, scheduleTimedEvent
 

Field Detail

EXECUTING_ASYNCHRONOUS_CALL

public static final String EXECUTING_ASYNCHRONOUS_CALL
See Also:
Constant Field Values
Constructor Detail

AbstractDispatcher

public AbstractDispatcher()
Method Detail

instance

public static Dispatcher instance()

scheduleTransactionSuccessEvent

public void scheduleTransactionSuccessEvent(String type,
                                            Object... parameters)
Description copied from interface: Dispatcher
Schedule an event to be processed if and when the current transaction completes successfully

Specified by:
scheduleTransactionSuccessEvent in interface Dispatcher<T,S extends Schedule>
Parameters:
type - the event type
parameters - parameters to pass to the event listener method

scheduleTransactionCompletionEvent

public void scheduleTransactionCompletionEvent(String type,
                                               Object... parameters)
Description copied from interface: Dispatcher
Schedule an event to be processed when the current transaction ends

Specified by:
scheduleTransactionCompletionEvent in interface Dispatcher<T,S extends Schedule>
Parameters:
type - the event type
parameters - parameters to pass to the event listener method

createSchedule

protected Schedule createSchedule(InvocationContext invocation)

createTimerSchedule

protected TimerSchedule createTimerSchedule(InvocationContext invocation)

extractAndValidateParameters

protected AbstractDispatcher.DispatcherParameters extractAndValidateParameters(InvocationContext invocation)