public final class ExecutorServiceFactory extends Object
Modifier and Type | Method and Description |
---|---|
static ExecutorService |
getExecutor(ExecutionModel tmodel)
Getter for the field
executor . |
static void |
init()
Call this method to initialize the
ExecutorService that is
used in STATIC_THREAD_POOL execution mode. |
static void |
setDefaultThreadPoolExecutor(ExecutorService executor)
Sets the default ExecutorService returned when this class is invoked
with
ExecutionModel.STATIC_THREAD_POOL . |
static void |
shutDown()
Call this method to finalize the execution queue.
|
public static ExecutorService getExecutor(ExecutionModel tmodel)
Getter for the field executor
.
tmodel
- a ExecutionModel
object.ExecutorService
object.public static void init()
Call this method to initialize the ExecutorService
that is
used in STATIC_THREAD_POOL
execution mode.
public static void setDefaultThreadPoolExecutor(ExecutorService executor)
Sets the default ExecutorService returned when this class is invoked
with ExecutionModel.STATIC_THREAD_POOL
.
It can also be used to initialize the class (for instance for use into a web application).
executor
- ExecutorService for the STATIC_THREAD_POOL model.public static void shutDown()
Call this method to finalize the execution queue.
It is mandatory when you use this library in a container, otherwise the
container doesn't terminate gracefully (for instance you can call it in
a web application context listener
ContextListener.shutdown()
).
Copyright © 2008–2016. All rights reserved.