org.apache.servicemix.executors.impl
Class ExecutorImpl

java.lang.Object
  extended by org.apache.servicemix.executors.impl.ExecutorImpl
All Implemented Interfaces:
Executor

public class ExecutorImpl
extends java.lang.Object
implements Executor

The default Executor implementation which uses a ThreadPoolExecutor underneath.

Author:
Guillaume Nodet

Constructor Summary
ExecutorImpl(ExecutorFactoryImpl executorFactory, java.util.concurrent.ThreadPoolExecutor threadPool, ExecutorConfig config)
           
 
Method Summary
 int capacity()
          The capacity of the underlying queue (if any)
 void execute(java.lang.Runnable command)
          Execute a command.
protected  ExecutorConfig getConfig()
          The configuration used for creating this executor instance
 java.util.concurrent.ThreadPoolExecutor getThreadPoolExecutor()
           
 void shutdown()
          Shutdown this executor.
 int size()
          The current size of the underlying queue (if any)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExecutorImpl

public ExecutorImpl(ExecutorFactoryImpl executorFactory,
                    java.util.concurrent.ThreadPoolExecutor threadPool,
                    ExecutorConfig config)
Method Detail

execute

public void execute(java.lang.Runnable command)
Description copied from interface: Executor
Execute a command.

Specified by:
execute in interface Executor
Parameters:
command - the command to execute

shutdown

public void shutdown()
Description copied from interface: Executor
Shutdown this executor. This must be called to kill all threads.

Specified by:
shutdown in interface Executor

capacity

public int capacity()
Description copied from interface: Executor
The capacity of the underlying queue (if any)

Specified by:
capacity in interface Executor
Returns:

size

public int size()
Description copied from interface: Executor
The current size of the underlying queue (if any)

Specified by:
size in interface Executor
Returns:

getThreadPoolExecutor

public java.util.concurrent.ThreadPoolExecutor getThreadPoolExecutor()

getConfig

protected ExecutorConfig getConfig()
The configuration used for creating this executor instance

Returns:
the configuration object


Copyright © 2005-2011 FuseSource. All Rights Reserved.