Novell exteNd
Director 5.2 API

com.sssw.fw.api
Interface EbiThreadPoolManager

All Known Implementing Classes:
EboThreadPoolManager

public interface EbiThreadPoolManager

abstraction of a Thread Pool

Since:
v.5.0

Field Summary
static String THREADPOOL_BLOCKED_ACTION_HANDLER
          key to specifiy pool behavior apon blocked action 0 - run when block 1 - wait when block 2 - abort when block 3 - discard when block 4- discard oldest when block
static String THREADPOOL_BUFFERSIZE
          key to access the config.xml for the size of thread request to buffer when the pool is busy
static String THREADPOOL_ENABLEATSTARTUP
          key to access the config.xml for
static String THREADPOOL_EXECUTOR_CLASS
          key to specifiy pool executor class to be used if specified, discards the THREADPOOL_BLOCKED_ACTION_HANDLER settings
static String THREADPOOL_INITIALTHREADS
          key to access the config.xml for the number of threads to initiate on pool start up
static String THREADPOOL_KEEPALIVETIME
          key to access the config.xml for the time (in milli seconds) that idle threads should be kept alife
static String THREADPOOL_MAXTHREADS
          key to access the config.xml for the max number of threads the pool should provide
static String THREADPOOL_MGR
          key to access the services.xml for the implementing class
static String THREADPOOL_MINTHREADS
          key to access the config.xml for the min number of threads the pool should provide
 
Method Summary
 void dumpStatistics()
          dump the current pool state to a default output stream (i.e.
 void dumpStatistics(Writer out)
          dump current pool state to the provided writer
 void execute(Runnable task)
          run a task using the thread pool (the task has to implement Runnable)
 void init(Map params)
          initialize your ThreadPool (if you need to)
 void interruptAll()
          interrupt all running threads
 boolean isAvailable()
          is the pool available / active ?
 boolean isTerminatedAfterShutdown()
          check if the pool has terminated (after the shutdown was called)
 List shutdown()
          shutdown the thread pool to free resources
 

Field Detail

THREADPOOL_MGR

public static final String THREADPOOL_MGR
key to access the services.xml for the implementing class

THREADPOOL_BUFFERSIZE

public static final String THREADPOOL_BUFFERSIZE
key to access the config.xml for the size of thread request to buffer when the pool is busy

THREADPOOL_MAXTHREADS

public static final String THREADPOOL_MAXTHREADS
key to access the config.xml for the max number of threads the pool should provide

THREADPOOL_MINTHREADS

public static final String THREADPOOL_MINTHREADS
key to access the config.xml for the min number of threads the pool should provide

THREADPOOL_INITIALTHREADS

public static final String THREADPOOL_INITIALTHREADS
key to access the config.xml for the number of threads to initiate on pool start up

THREADPOOL_KEEPALIVETIME

public static final String THREADPOOL_KEEPALIVETIME
key to access the config.xml for the time (in milli seconds) that idle threads should be kept alife

THREADPOOL_ENABLEATSTARTUP

public static final String THREADPOOL_ENABLEATSTARTUP
key to access the config.xml for

THREADPOOL_BLOCKED_ACTION_HANDLER

public static final String THREADPOOL_BLOCKED_ACTION_HANDLER
key to specifiy pool behavior apon blocked action 0 - run when block 1 - wait when block 2 - abort when block 3 - discard when block 4- discard oldest when block

THREADPOOL_EXECUTOR_CLASS

public static final String THREADPOOL_EXECUTOR_CLASS
key to specifiy pool executor class to be used if specified, discards the THREADPOOL_BLOCKED_ACTION_HANDLER settings
Method Detail

init

public void init(Map params)
initialize your ThreadPool (if you need to)
Parameters:
params - a map of params to initialize the thread pool
Since:
v.5.0

execute

public void execute(Runnable task)
             throws InterruptedException
run a task using the thread pool (the task has to implement Runnable)
Parameters:
task - the Runnable task
Throws:
InterruptedException - when the thread gets interrupted
Since:
v.5.0

interruptAll

public void interruptAll()
interrupt all running threads
Since:
v.5.0

shutdown

public List shutdown()
shutdown the thread pool to free resources
Returns:
a java.util.List of tasks (Runnable) that have not yet been processed (from the buffer), or null
Since:
v.5.0

isTerminatedAfterShutdown

public boolean isTerminatedAfterShutdown()
check if the pool has terminated (after the shutdown was called)
Returns:
true if the pool is shutdown , false if it's still up
Since:
v.5.0

dumpStatistics

public void dumpStatistics(Writer out)
dump current pool state to the provided writer
Parameters:
out - a Writer to write to
Since:
v.5.0

dumpStatistics

public void dumpStatistics()
dump the current pool state to a default output stream (i.e. System.out)
Since:
v.5.0

isAvailable

public boolean isAvailable()
is the pool available / active ?
Returns:
true if it is, false if not
Since:
v.5.0

Novell exteNd
Director 5.2 API