Class DefaultManagedTaskScheduler
java.lang.Object
org.springframework.scheduling.concurrent.ConcurrentTaskExecutor
org.springframework.scheduling.concurrent.ConcurrentTaskScheduler
org.springframework.scheduling.concurrent.DefaultManagedTaskScheduler
- All Implemented Interfaces:
Executor, InitializingBean, AsyncTaskExecutor, TaskExecutor, SchedulingTaskExecutor, TaskScheduler
public class DefaultManagedTaskScheduler
extends ConcurrentTaskScheduler
implements InitializingBean
JNDI-based variant of
ConcurrentTaskScheduler, performing a default lookup for
JSR-236's "java:comp/DefaultManagedScheduledExecutorService" in a Jakarta EE environment.
Expected to be exposed as a bean, in particular as the default lookup happens in the
standard InitializingBean.afterPropertiesSet() callback.
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.
- Since:
- 4.0
- Author:
- Juergen Hoeller
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class ConcurrentTaskExecutor
ConcurrentTaskExecutor.ManagedTaskBuilder -
Field Summary
Fields inherited from interface AsyncTaskExecutor
TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidInvoked by the containingBeanFactoryafter it has set all bean properties and satisfiedBeanFactoryAware,ApplicationContextAwareetc.voidsetJndiEnvironment(Properties jndiEnvironment) Set the JNDI environment to use for JNDI lookups.voidsetJndiName(String jndiName) Specify a JNDI name of theExecutorto delegate to, replacing the default JNDI name "java:comp/DefaultManagedScheduledExecutorService".voidsetJndiTemplate(JndiTemplate jndiTemplate) Set the JNDI template to use for JNDI lookups.voidsetResourceRef(boolean resourceRef) Set whether the lookup occurs in a Jakarta EE container, i.e.Methods inherited from class ConcurrentTaskScheduler
execute, getClock, schedule, schedule, scheduleAtFixedRate, scheduleAtFixedRate, scheduleWithFixedDelay, scheduleWithFixedDelay, setClock, setErrorHandler, setScheduledExecutor, submit, submitMethods inherited from class ConcurrentTaskExecutor
execute, getConcurrentExecutor, setConcurrentExecutor, setTaskDecoratorMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AsyncTaskExecutor
submitCompletable, submitCompletableMethods inherited from interface SchedulingTaskExecutor
prefersShortLivedTasksMethods inherited from interface TaskScheduler
schedule, scheduleAtFixedRate, scheduleAtFixedRate, scheduleWithFixedDelay, scheduleWithFixedDelay
-
Constructor Details
-
DefaultManagedTaskScheduler
public DefaultManagedTaskScheduler()
-
-
Method Details
-
setJndiTemplate
Set the JNDI template to use for JNDI lookups.- See Also:
-
setJndiEnvironment
Set the JNDI environment to use for JNDI lookups.- See Also:
-
setResourceRef
public void setResourceRef(boolean resourceRef) Set whether the lookup occurs in a Jakarta EE 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".- See Also:
-
setJndiName
Specify a JNDI name of theExecutorto 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".
- See Also:
-
afterPropertiesSet
Description copied from interface:InitializingBeanInvoked by the containingBeanFactoryafter it has set all bean properties and satisfiedBeanFactoryAware,ApplicationContextAwareetc.This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.
- Specified by:
afterPropertiesSetin interfaceInitializingBean- Throws:
NamingException
-