org.jboss.seam.async
Class ThreadPoolDispatcher

java.lang.Object
  extended by org.jboss.seam.async.AbstractDispatcher<Future,TimerSchedule>
      extended by org.jboss.seam.async.ThreadPoolDispatcher
All Implemented Interfaces:
Dispatcher<Future,TimerSchedule>

@Scope(value=APPLICATION)
@Name(value="org.jboss.seam.async.dispatcher")
@Install(precedence=0)
public class ThreadPoolDispatcher
extends AbstractDispatcher<Future,TimerSchedule>

Dispatcher implementation that uses a java.util.concurrent ScheduledThreadPoolExecutor.

Author:
Gavin King

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jboss.seam.async.AbstractDispatcher
AbstractDispatcher.DispatcherParameters
 
Field Summary
 
Fields inherited from class org.jboss.seam.async.AbstractDispatcher
EXECUTING_ASYNCHRONOUS_CALL
 
Constructor Summary
ThreadPoolDispatcher()
           
 
Method Summary
 void destroy()
           
 int getThreadPoolSize()
           
 Future scheduleAsynchronousEvent(String type, Object... parameters)
          Schedule an immediate asynchronous event
 Future scheduleInvocation(InvocationContext invocation, Component component)
          Schedule an asynchronous method call, examining annotations upon the method to determine the schedule
 Future scheduleTimedEvent(String type, TimerSchedule schedule, Object... parameters)
          Schedule a timed (delayed and/or periodic) event
 void setThreadPoolSize(int threadPoolSize)
           
 void startup()
           
 
Methods inherited from class org.jboss.seam.async.AbstractDispatcher
createSchedule, createTimerSchedule, extractAndValidateParameters, instance, scheduleTransactionCompletionEvent, scheduleTransactionSuccessEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadPoolDispatcher

public ThreadPoolDispatcher()
Method Detail

startup

@Create
public void startup()

scheduleAsynchronousEvent

public Future scheduleAsynchronousEvent(String type,
                                        Object... parameters)
Description copied from interface: Dispatcher
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

scheduleTimedEvent

public Future scheduleTimedEvent(String type,
                                 TimerSchedule schedule,
                                 Object... parameters)
Description copied from interface: Dispatcher
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

scheduleInvocation

public Future scheduleInvocation(InvocationContext invocation,
                                 Component component)
Description copied from interface: Dispatcher
Schedule an asynchronous method call, examining annotations upon the method to determine the schedule

Returns:
some kind of timer object, or null

destroy

@Destroy
public void destroy()

getThreadPoolSize

public int getThreadPoolSize()

setThreadPoolSize

public void setThreadPoolSize(int threadPoolSize)


Copyright © 2011 Seam Framework. All Rights Reserved.