public class DefaultManagedTaskScheduler extends ConcurrentTaskScheduler implements InitializingBean
ConcurrentTaskScheduler
, performing a default lookup for
JSR-236's "java:comp/DefaultManagedScheduledExecutorService" in a Java EE 7 environment.
Note: This class is not strictly JSR-236 based; it can work with any regular
ScheduledExecutorService
that can be found in JNDI.
The actual adapting to ManagedScheduledExecutorService
happens in the base class ConcurrentTaskScheduler
itself.
ManagedScheduledExecutorService
ConcurrentTaskExecutor.ManagedTaskBuilder
TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE
Constructor and Description |
---|
DefaultManagedTaskScheduler() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
Invoked by the containing
BeanFactory after it has set all bean properties
and satisfied BeanFactoryAware , ApplicationContextAware etc. |
void |
setJndiEnvironment(Properties jndiEnvironment)
Set the JNDI environment to use for JNDI lookups.
|
void |
setJndiName(String jndiName)
Specify a JNDI name of the
Executor to delegate to,
replacing the default JNDI name "java:comp/DefaultManagedScheduledExecutorService". |
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.
|
schedule, schedule, scheduleAtFixedRate, scheduleAtFixedRate, scheduleWithFixedDelay, scheduleWithFixedDelay, setErrorHandler, setScheduledExecutor
execute, execute, getConcurrentExecutor, setConcurrentExecutor, setTaskDecorator, submit, submit, submitListenable, submitListenable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
schedule, scheduleAtFixedRate, scheduleAtFixedRate, scheduleWithFixedDelay, scheduleWithFixedDelay
prefersShortLivedTasks
public void setJndiTemplate(JndiTemplate jndiTemplate)
public void setJndiEnvironment(Properties jndiEnvironment)
public void setResourceRef(boolean resourceRef)
public void setJndiName(String jndiName)
Executor
to delegate to,
replacing the default JNDI name "java:comp/DefaultManagedScheduledExecutorService".
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 NamingException
InitializingBean
BeanFactory
after it has set all bean properties
and satisfied BeanFactoryAware
, 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
in interface InitializingBean
NamingException