|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.sling.commons.threads.impl.DefaultThreadPool
public class DefaultThreadPool
The DefaultThreadPool class implements the ThreadPool interface.
Instances of this class are managed by the ThreadPoolManager.
| Field Summary | |
|---|---|
protected ModifiableThreadPoolConfig |
configuration
|
protected ThreadPoolExecutor |
executor
The executor. |
protected org.slf4j.Logger |
logger
By default we use the logger for this class. |
protected String |
name
The name of this thread pool |
| Constructor Summary | |
|---|---|
DefaultThreadPool(String name,
ThreadPoolConfig origConfig)
Create a new thread pool. |
|
| Method Summary | ||
|---|---|---|
void |
execute(Runnable runnable)
Execute a runnable |
|
ThreadPoolConfig |
getConfiguration()
The thread pool configuration. |
|
ThreadPoolExecutor |
getExecutor()
|
|
String |
getName()
The name of the thread pool. |
|
void |
shutdown()
Shut down the threadpool. |
|
|
submit(Callable<T> callable)
Submits a callable for execution |
|
Future<?> |
submit(Runnable runnable)
Submits a runnable for execution |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final org.slf4j.Logger logger
protected final String name
protected ThreadPoolExecutor executor
protected final ModifiableThreadPoolConfig configuration
| Constructor Detail |
|---|
public DefaultThreadPool(String name,
ThreadPoolConfig origConfig)
name - - The name of the thread pool. If null ThreadPoolManager.DEFAULT_THREADPOOL_NAME
is used| Method Detail |
|---|
public String getName()
ThreadPool
getName in interface ThreadPoolThreadPool.getName()public ThreadPoolConfig getConfiguration()
ThreadPool
getConfiguration in interface ThreadPoolThreadPool.getConfiguration()public void execute(Runnable runnable)
ThreadPool
execute in interface ThreadPoolrunnable - The Runnable to executeThreadPool.execute(java.lang.Runnable)public <T> Future<T> submit(Callable<T> callable)
ThreadPool
submit in interface ThreadPoolcallable - The Callable to submit
Future representing pending completion of the CallableThreadPool.submit(java.util.concurrent.Callable)public Future<?> submit(Runnable runnable)
ThreadPool
submit in interface ThreadPoolrunnable - The Runnable to submit
Future representing pending completion of the RunnableThreadPool.submit(java.lang.Runnable)public void shutdown()
public ThreadPoolExecutor getExecutor()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||