public static class XdevExecutorService.Implementation extends Object implements XdevExecutorService
XdevExecutorService
contract.XdevExecutorService.Factory, XdevExecutorService.Implementation
GRACEFUL_SHUTDOWN_INIT_PARAMETER, THREAD_COUNT_INIT_PARAMETER
Constructor and Description |
---|
Implementation(javax.servlet.ServletContext context) |
Modifier and Type | Method and Description |
---|---|
void |
execute(Runnable command) |
protected <T> CallableAccessWrapper<T> |
getCallableAccessWrapper(Callable<T> callabale) |
protected RunnableAccessWrapper |
getRunnableAccessWrapper(Runnable runnable) |
void |
shutdown()
Initiates a shutdown of the executor service.
|
<T> Future<T> |
submit(Callable<T> task)
Submits a value-returning task for execution and returns a Future
representing the pending results of the task.
|
Future<?> |
submit(Runnable task)
Submits a Runnable task for execution and returns a Future representing
that task.
|
<T> Future<T> |
submit(Runnable task,
T result)
Submits a Runnable task for execution and returns a Future representing
that task.
|
public Future<?> submit(Runnable task)
XdevExecutorService
get
method will return null
upon
successful completion.submit
in interface XdevExecutorService
task
- the task to submitpublic <T> Future<T> submit(Runnable task, T result)
XdevExecutorService
get
method will return the given result
upon successful completion.submit
in interface XdevExecutorService
T
- the type of the resulttask
- the task to submitresult
- the result to returnpublic <T> Future<T> submit(Callable<T> task)
XdevExecutorService
get
method will return the task's result upon successful completion.
If you would like to immediately block waiting for a task, you can use
constructions of the form result = exec.submit(aCallable).get();
submit
in interface XdevExecutorService
T
- the type of the task's resulttask
- the task to submitprotected RunnableAccessWrapper getRunnableAccessWrapper(Runnable runnable)
protected <T> CallableAccessWrapper<T> getCallableAccessWrapper(Callable<T> callabale)
public void shutdown()
XdevExecutorService
shutdown
in interface XdevExecutorService
Copyright © 2017 XDEV Software Corp.. All rights reserved.