|
Apache Tomcat 7.0.20 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.tomcat.util.threads.DedicatedThreadExecutor
public class DedicatedThreadExecutor
A utility class to execute a Callable in a dedicated thread.
It can be used either with an instance to reuse the same thread for each call
to execute(Callable) or with the static method
executeInOwnThread(Callable). When using an instance,
shutdown() must be called when the instance is no longer needed to
dispose of the dedicated thread.
| Constructor Summary | |
|---|---|
DedicatedThreadExecutor()
|
|
| Method Summary | ||
|---|---|---|
|
execute(Callable<V> callable)
Executes the given Callable with the thread spawned for the
current DedicatedThreadExecutor instance, and returns its result. |
|
static
|
executeInOwnThread(Callable<V> callable)
Executes the given Callable in a new thread and returns the
result after the thread is stopped. |
|
void |
shutdown()
Stops the dedicated thread and waits for its death. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DedicatedThreadExecutor()
| Method Detail |
|---|
public <V> V execute(Callable<V> callable)
Callable with the thread spawned for the
current DedicatedThreadExecutor instance, and returns its result.
V - the type of the returned valuecallable -
public void shutdown()
public static <V> V executeInOwnThread(Callable<V> callable)
Callable in a new thread and returns the
result after the thread is stopped.
V - callable -
|
Apache Tomcat 7.0.20 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||