org.apache.sling.commons.threads.impl
Class DefaultThreadPool

java.lang.Object
  extended by org.apache.sling.commons.threads.impl.DefaultThreadPool
All Implemented Interfaces:
ThreadPool

public class DefaultThreadPool
extends Object
implements ThreadPool

The DefaultThreadPool class implements the ThreadPool interface. Instances of this class are managed by the ThreadPoolManager.


Field Summary
protected  ModifiableThreadPoolConfig configuration
           
protected  java.util.concurrent.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.
 java.util.concurrent.ThreadPoolExecutor getExecutor()
           
 String getName()
          The name of the thread pool.
 void shutdown()
          Shut down the threadpool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.slf4j.Logger logger
By default we use the logger for this class.


name

protected final String name
The name of this thread pool


executor

protected java.util.concurrent.ThreadPoolExecutor executor
The executor.


configuration

protected final ModifiableThreadPoolConfig configuration
Constructor Detail

DefaultThreadPool

public DefaultThreadPool(String name,
                         ThreadPoolConfig origConfig)
Create a new thread pool.

Parameters:
name - - The name of the thread pool. If null ThreadPoolManager.DEFAULT_THREADPOOL_NAME is used
Method Detail

getName

public String getName()
Description copied from interface: ThreadPool
The name of the thread pool.

Specified by:
getName in interface ThreadPool
See Also:
ThreadPool.getName()

getConfiguration

public ThreadPoolConfig getConfiguration()
Description copied from interface: ThreadPool
The thread pool configuration.

Specified by:
getConfiguration in interface ThreadPool
See Also:
ThreadPool.getConfiguration()

execute

public void execute(Runnable runnable)
Description copied from interface: ThreadPool
Execute a runnable

Specified by:
execute in interface ThreadPool
Parameters:
runnable - The Runnable to execute
See Also:
ThreadPool.execute(java.lang.Runnable)

shutdown

public void shutdown()
Shut down the threadpool.


getExecutor

public java.util.concurrent.ThreadPoolExecutor getExecutor()


Copyright © 2007-2013 The Apache Software Foundation. All Rights Reserved.