org.apache.sling.commons.threads
Interface ThreadPoolManager


public interface ThreadPoolManager

The ThreadPoolManager manages thread pools.

Version:
$Id: ThreadPoolManager.java 653306 2008-05-05 06:31:05Z cziegeler $

Field Summary
static java.lang.String DEFAULT_THREADPOOL_NAME
          The default thread pool name
 
Method Summary
 boolean add(ThreadPool pool)
          Add a new pool.
 ThreadPool create(java.lang.String name, ThreadPoolConfig config)
          Create a new thread pool.
 ThreadPool get(java.lang.String name)
          Get a thread pool.
 

Field Detail

DEFAULT_THREADPOOL_NAME

static final java.lang.String DEFAULT_THREADPOOL_NAME
The default thread pool name

See Also:
Constant Field Values
Method Detail

add

boolean add(ThreadPool pool)
Add a new pool. If a pool with the same name already exists, the new pool is not added and false is returned.

Parameters:
pool - The pool.
Returns:
True if the pool could be added, false otherwise.

get

ThreadPool get(java.lang.String name)
Get a thread pool. If there is no thread pool with the given name, the default thread pool is returned.

Parameters:
name - The name of the thread pool or null for the default pool.

create

ThreadPool create(java.lang.String name,
                  ThreadPoolConfig config)
Create a new thread pool. If a pool with the same name already exists, no new pool is created and null is returned.

Parameters:
name - Name must not be null.
config - The thread pool configuration.


Copyright © 2007-2009. All Rights Reserved.