public class DefaultManagedTaskExecutor extends ConcurrentTaskExecutor implements InitializingBean
ConcurrentTaskExecutor
, performing a default lookup for
JSR-236's "java:comp/DefaultManagedExecutorService" in a Java EE 7 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 to javax.enterprise.concurrent.ManagedExecutorService
happens in the base class ConcurrentTaskExecutor
itself.
ConcurrentTaskExecutor.ManagedTaskBuilder
Modifier and Type | Field and Description |
---|---|
private JndiLocatorDelegate |
jndiLocator |
private java.lang.String |
jndiName |
TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE
Constructor and Description |
---|
DefaultManagedTaskExecutor() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied
(and satisfied BeanFactoryAware and ApplicationContextAware).
|
void |
setJndiEnvironment(java.util.Properties jndiEnvironment)
Set the JNDI environment to use for JNDI lookups.
|
void |
setJndiName(java.lang.String jndiName)
Specify a JNDI name of the
Executor 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 Java EE container, i.e.
|
execute, execute, getConcurrentExecutor, prefersShortLivedTasks, setConcurrentExecutor, setTaskDecorator, submit, submit, submitListenable, submitListenable
private JndiLocatorDelegate jndiLocator
private java.lang.String jndiName
public void setJndiTemplate(JndiTemplate jndiTemplate)
public void setJndiEnvironment(java.util.Properties jndiEnvironment)
public void setResourceRef(boolean resourceRef)
public void setJndiName(java.lang.String jndiName)
Executor
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".
public void afterPropertiesSet() throws javax.naming.NamingException
InitializingBean
This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.
afterPropertiesSet
in interface InitializingBean
javax.naming.NamingException