类 ExecutorServiceAdapter
- java.lang.Object
- java.util.concurrent.AbstractExecutorService
- org.springframework.core.task.support.ExecutorServiceAdapter
- 所有已实现的接口:
Executor
,ExecutorService
public class ExecutorServiceAdapter extends AbstractExecutorService
Adapter that takes a SpringTaskExecutor
and exposes a fulljava.util.concurrent.ExecutorService
for it.This is primarily for adapting to client components that communicate via the
java.util.concurrent.ExecutorService
API. It can also be used as common ground between a local SpringTaskExecutor
backend and a JNDI-locatedManagedExecutorService
in a Java EE 7 environment.NOTE: This ExecutorService adapter does not support the lifecycle methods in the
java.util.concurrent.ExecutorService
API ("shutdown()" etc), similar to a server-wideManagedExecutorService
in a Java EE 7 environment. The lifecycle is always up to the backend pool, with this adapter acting as an access-only proxy for that target pool.- 从以下版本开始:
- 3.0
- 作者:
- Juergen Hoeller
- 另请参阅:
ExecutorService
构造器概要
构造器 构造器 说明 ExecutorServiceAdapter(TaskExecutor taskExecutor)
Create a new ExecutorServiceAdapter, using the given target executor.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 boolean
awaitTermination(long timeout, TimeUnit unit)
void
execute(Runnable task)
boolean
isShutdown()
boolean
isTerminated()
void
shutdown()
List<Runnable>
shutdownNow()
从类继承的方法 java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
构造器详细资料
ExecutorServiceAdapter
public ExecutorServiceAdapter(TaskExecutor taskExecutor)
Create a new ExecutorServiceAdapter, using the given target executor.- 参数:
taskExecutor
- the target executor to delegate to
方法详细资料
shutdown
public void shutdown()
shutdownNow
public List<Runnable> shutdownNow()
awaitTermination
public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException
isShutdown
public boolean isShutdown()
isTerminated
public boolean isTerminated()