org.jboss.seam.async
Interface Dispatcher<T,S>

Type Parameters:
T - the type of the timer object
All Known Subinterfaces:
LocalTimerServiceDispatcher
All Known Implementing Classes:
AbstractDispatcher, QuartzDispatcher, ThreadPoolDispatcher, TimerServiceDispatcher

public interface Dispatcher<T,S>

Interface to be implemented by any strategy for dispatching asynchronous method calls and asynchronous events.

Author:
Gavin King

Method Summary
 T scheduleAsynchronousEvent(String type, Object... parameters)
          Schedule an immediate asynchronous event
 T scheduleInvocation(InvocationContext invocation, Component component)
          Schedule an asynchronous method call, examining annotations upon the method to determine the schedule
 T scheduleTimedEvent(String type, S schedule, Object... parameters)
          Schedule a timed (delayed and/or periodic) event
 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
 

Method Detail

scheduleInvocation

T scheduleInvocation(InvocationContext invocation,
                     Component component)
Schedule an asynchronous method call, examining annotations upon the method to determine the schedule

Returns:
some kind of timer object, or null

scheduleTimedEvent

T scheduleTimedEvent(String type,
                     S schedule,
                     Object... parameters)
Schedule a timed (delayed and/or periodic) event

Parameters:
type - the event type
schedule - the schedule
parameters - parameters to pass to the event listener method
Returns:
some kind of timer object, or null

scheduleAsynchronousEvent

T scheduleAsynchronousEvent(String type,
                            Object... parameters)
Schedule an immediate asynchronous event

Parameters:
type - the event type
parameters - parameters to pass to the event listener method
Returns:
some kind of timer object, or null

scheduleTransactionSuccessEvent

void scheduleTransactionSuccessEvent(String type,
                                     Object... parameters)
Schedule an event to be processed if and when the current transaction completes successfully

Parameters:
type - the event type
parameters - parameters to pass to the event listener method

scheduleTransactionCompletionEvent

void scheduleTransactionCompletionEvent(String type,
                                        Object... parameters)
Schedule an event to be processed when the current transaction ends

Parameters:
type - the event type
parameters - parameters to pass to the event listener method