net.sf.seide.controller.impl
Class DirectThreadPoolStageController

java.lang.Object
  extended by net.sf.seide.controller.impl.DirectThreadPoolStageController
All Implemented Interfaces:
StageController, DispatcherAware, Lifecycle

public class DirectThreadPoolStageController
extends Object
implements StageController

Author:
german.kondolf

Field Summary
protected  int configuredTimeout
           
protected  Dispatcher dispatcher
           
protected  ExecutorService executor
           
protected  ThreadPoolExecutorFactory executorFactory
           
protected  RuntimeStage runtimeStage
           
protected  boolean started
           
protected  boolean stopRequired
           
static String THREAD_POOL_EXECUTOR_MXBEAN_PREFIX
           
protected  int timeout
           
protected  ScheduledThreadPoolExecutor timeoutMonitorExecutor
           
protected  int timeoutMonitorThreadCount
           
 
Constructor Summary
DirectThreadPoolStageController()
           
 
Method Summary
protected  Runnable customize(Event event, RunnableEventHandlerWrapper originalRunnable)
          Customizable Runnable creation to wrap around the original RunnableEventHandlerWrapper.
 void execute(Event event)
          Execution handler for the given stage.
 Dispatcher getDispatcher()
           
 ThreadPoolExecutorFactory getExecutorFactory()
           
 boolean isRunning()
           
 void setDispatcher(Dispatcher dispatcher)
           
 void setExecutorFactory(ThreadPoolExecutorFactory executorFactory)
           
 void setRuntimeStage(RuntimeStage runtimeStage)
          Runtime configuration of the running Stage (RuntimeStage).
 void setTimeout(int timeout)
           
 void setTimeoutMonitorThreadCount(int timeoutMonitorThreadCount)
           
 void start()
          Starts the object implementation's lifecycle.
 void stop()
          Stops the object implementation's lifecycle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

THREAD_POOL_EXECUTOR_MXBEAN_PREFIX

public static final String THREAD_POOL_EXECUTOR_MXBEAN_PREFIX
See Also:
Constant Field Values

executorFactory

protected ThreadPoolExecutorFactory executorFactory

dispatcher

protected Dispatcher dispatcher

runtimeStage

protected RuntimeStage runtimeStage

executor

protected ExecutorService executor

timeout

protected int timeout

configuredTimeout

protected int configuredTimeout

timeoutMonitorThreadCount

protected int timeoutMonitorThreadCount

timeoutMonitorExecutor

protected ScheduledThreadPoolExecutor timeoutMonitorExecutor

started

protected volatile boolean started

stopRequired

protected volatile boolean stopRequired
Constructor Detail

DirectThreadPoolStageController

public DirectThreadPoolStageController()
Method Detail

execute

public void execute(Event event)
Description copied from interface: StageController
Execution handler for the given stage.

Specified by:
execute in interface StageController

customize

@Beta
protected Runnable customize(Event event,
                                  RunnableEventHandlerWrapper originalRunnable)
Customizable Runnable creation to wrap around the original RunnableEventHandlerWrapper.
Expert use only!

Parameters:
event -
Returns:

start

public void start()
Description copied from interface: Lifecycle
Starts the object implementation's lifecycle.

Specified by:
start in interface Lifecycle

stop

public void stop()
Description copied from interface: Lifecycle
Stops the object implementation's lifecycle.

Specified by:
stop in interface Lifecycle

getDispatcher

public Dispatcher getDispatcher()
Specified by:
getDispatcher in interface DispatcherAware

setDispatcher

public void setDispatcher(Dispatcher dispatcher)
Specified by:
setDispatcher in interface DispatcherAware

setRuntimeStage

public void setRuntimeStage(RuntimeStage runtimeStage)
Description copied from interface: StageController
Runtime configuration of the running Stage (RuntimeStage).

Specified by:
setRuntimeStage in interface StageController

setExecutorFactory

public void setExecutorFactory(ThreadPoolExecutorFactory executorFactory)

getExecutorFactory

public ThreadPoolExecutorFactory getExecutorFactory()

setTimeout

public void setTimeout(int timeout)

setTimeoutMonitorThreadCount

public void setTimeoutMonitorThreadCount(int timeoutMonitorThreadCount)

isRunning

public boolean isRunning()
Specified by:
isRunning in interface Lifecycle
Returns:
is the daemon running now?


Copyright © 2011. All Rights Reserved.