类 DefaultManagedTaskExecutor
- java.lang.Object
- org.springframework.scheduling.concurrent.ConcurrentTaskExecutor
- org.springframework.scheduling.concurrent.DefaultManagedTaskExecutor
- 所有已实现的接口:
Executor
,InitializingBean
,AsyncListenableTaskExecutor
,AsyncTaskExecutor
,TaskExecutor
,SchedulingTaskExecutor
public class DefaultManagedTaskExecutor extends ConcurrentTaskExecutor implements InitializingBean
JNDI-based variant ofConcurrentTaskExecutor
, performing a default lookup for JSR-236's "java:comp/DefaultManagedExecutorService" in a Java EE 7/8 environment.Note: This class is not strictly JSR-236 based; it can work with any regular
Executor
that can be found in JNDI. The actual adapting toManagedExecutorService
happens in the base classConcurrentTaskExecutor
itself.- 从以下版本开始:
- 4.0
- 作者:
- Juergen Hoeller
- 另请参阅:
ManagedExecutorService
嵌套类概要
从类继承的嵌套类/接口 org.springframework.scheduling.concurrent.ConcurrentTaskExecutor
ConcurrentTaskExecutor.ManagedTaskBuilder
字段概要
从接口继承的字段 org.springframework.core.task.AsyncTaskExecutor
TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE
构造器概要
构造器 构造器 说明 DefaultManagedTaskExecutor()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
afterPropertiesSet()
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.void
setJndiEnvironment(Properties jndiEnvironment)
Set the JNDI environment to use for JNDI lookups.void
setJndiName(String jndiName)
Specify a JNDI name of theExecutor
to delegate to, replacing the default JNDI name "java:comp/DefaultManagedExecutorService".void
setJndiTemplate(JndiTemplate jndiTemplate)
Set the JNDI template to use for JNDI lookups.void
setResourceRef(boolean resourceRef)
Set whether the lookup occurs in a J2EE container, i.e. if the prefix "java:comp/env/" needs to be added if the JNDI name doesn't already contain it.从类继承的方法 org.springframework.scheduling.concurrent.ConcurrentTaskExecutor
execute, execute, getConcurrentExecutor, prefersShortLivedTasks, setConcurrentExecutor, setTaskDecorator, submit, submit, submitListenable, submitListenable
构造器详细资料
DefaultManagedTaskExecutor
public DefaultManagedTaskExecutor()
方法详细资料
setJndiTemplate
public void setJndiTemplate(JndiTemplate jndiTemplate)
Set the JNDI template to use for JNDI lookups.
setJndiEnvironment
public void setJndiEnvironment(Properties jndiEnvironment)
Set the JNDI environment to use for JNDI lookups.
setResourceRef
public void setResourceRef(boolean resourceRef)
Set whether the lookup occurs in a J2EE container, i.e. if the prefix "java:comp/env/" needs to be added if the JNDI name doesn't already contain it. PersistenceAnnotationBeanPostProcessor's default is "true".
setJndiName
public void setJndiName(String jndiName)
Specify a JNDI name of theExecutor
to delegate to, replacing the default JNDI name "java:comp/DefaultManagedExecutorService".This can either be a fully qualified JNDI name, or the JNDI name relative to the current environment naming context if "resourceRef" is set to "true".
afterPropertiesSet
public void afterPropertiesSet() throws NamingException
从接口复制的说明:InitializingBean
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.
- 指定者:
afterPropertiesSet
在接口中InitializingBean
- 抛出:
NamingException