Top Description Fields Constructors Methods
org.springframework.scheduling.concurrent

public Class DefaultManagedTaskScheduler

extends ConcurrentTaskScheduler
implements InitializingBean
Class Inheritance
All Implemented Interfaces
org.springframework.beans.factory.InitializingBean
Imports
java.util.Properties, java.util.concurrent.ScheduledExecutorService, javax.naming.NamingException, org.springframework.beans.factory.InitializingBean, org.springframework.jndi.JndiLocatorDelegate, .JndiTemplate

References Deprecated

ConcurrentTaskScheduler is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

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 java.util.concurrent.ScheduledExecutorService that can be found in JNDI. The actual adapting to jakarta.enterprise.concurrent.ManagedScheduledExecutorService happens in the base class ConcurrentTaskScheduler itself.

Author
Juergen Hoeller
Since
4.0
See Also
jakarta.enterprise.concurrent.ManagedScheduledExecutorService

Field Summary

Modifier and TypeField and Description
private final JndiLocatorDelegate
private String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
afterPropertiesSet()

Implements org.springframework.beans.factory.InitializingBean.afterPropertiesSet.

Invoked by the containing 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.

public void
setJndiEnvironment(Properties jndiEnvironment)

Set the JNDI environment to use for JNDI lookups.

public void
setJndiName(String jndiName)

Specify a JNDI name of the java.util.concurrent.Executor to delegate to, replacing the default JNDI name "java:comp/DefaultManagedScheduledExecutorService".

public void
setJndiTemplate(JndiTemplate jndiTemplate)

Set the JNDI template to use for JNDI lookups.

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.

Inherited from org.springframework.scheduling.concurrent.ConcurrentTaskScheduler:
getClockscheduleschedulescheduleAtFixedRatescheduleAtFixedRatescheduleWithFixedDelayscheduleWithFixedDelaysetClocksetErrorHandlersetScheduledExecutor

Field Detail

jndiLocatorback to summary
private final JndiLocatorDelegate jndiLocator
jndiNameback to summary
private String jndiName

Constructor Detail

DefaultManagedTaskSchedulerback to summary
public DefaultManagedTaskScheduler()

Method Detail

afterPropertiesSetback to summary
public void afterPropertiesSet() throws NamingException

Implements org.springframework.beans.factory.InitializingBean.afterPropertiesSet.

Doc from org.springframework.beans.factory.InitializingBean.afterPropertiesSet.

Invoked by the containing 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.

Annotations
@Override
setJndiEnvironmentback to summary
public void setJndiEnvironment(Properties jndiEnvironment)

Set the JNDI environment to use for JNDI lookups.

See Also
org.springframework.jndi.JndiAccessor#setJndiEnvironment
setJndiNameback to summary
public void setJndiName(String jndiName)

Specify a JNDI name of the java.util.concurrent.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".

See Also
setConcurrentExecutor, setResourceRef
setJndiTemplateback to summary
public void setJndiTemplate(JndiTemplate jndiTemplate)

Set the JNDI template to use for JNDI lookups.

See Also
org.springframework.jndi.JndiAccessor#setJndiTemplate
setResourceRefback to summary
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
org.springframework.jndi.JndiLocatorSupport#setResourceRef