类 TimerManagerAccessor
- java.lang.Object
- org.springframework.jndi.JndiAccessor
- org.springframework.jndi.JndiLocatorSupport
- org.springframework.scheduling.commonj.TimerManagerAccessor
- 所有已实现的接口:
DisposableBean
,InitializingBean
,Lifecycle
@Deprecated public abstract class TimerManagerAccessor extends JndiLocatorSupport implements InitializingBean, DisposableBean, Lifecycle
已过时。as of 5.1, in favor of EE 7'sDefaultManagedTaskScheduler
Base class for classes that are accessing a CommonJTimerManager
Defines common configuration settings and common lifecycle handling.- 从以下版本开始:
- 3.0
- 作者:
- Juergen Hoeller
- 另请参阅:
TimerManager
字段概要
从类继承的字段 org.springframework.jndi.JndiLocatorSupport
CONTAINER_PREFIX
从类继承的字段 org.springframework.jndi.JndiAccessor
logger
构造器概要
构造器 构造器 说明 TimerManagerAccessor()
已过时。
方法概要
所有方法 实例方法 具体方法 已过时的方法 修饰符和类型 方法 说明 void
afterPropertiesSet()
已过时。Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.void
destroy()
已过时。Stops the underlying TimerManager (if not shared).protected TimerManager
getTimerManager()
已过时。Return the configured TimerManager, if any.boolean
isRunning()
已过时。Considers the underlying TimerManager as running if it is neither suspending nor stopping.protected TimerManager
obtainTimerManager()
已过时。Obtain the TimerManager for actual use.void
setShared(boolean shared)
已过时。Specify whether the TimerManager obtained by this FactoryBean is a shared instance ("true") or an independent instance ("false").void
setTimerManager(TimerManager timerManager)
已过时。Specify the CommonJ TimerManager to delegate to.void
setTimerManagerName(String timerManagerName)
已过时。Set the JNDI name of the CommonJ TimerManager.void
start()
已过时。Resumes the underlying TimerManager (if not shared).void
stop()
已过时。Suspends the underlying TimerManager (if not shared).从类继承的方法 org.springframework.jndi.JndiLocatorSupport
convertJndiName, isResourceRef, lookup, lookup, setResourceRef
从类继承的方法 org.springframework.jndi.JndiAccessor
getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate
构造器详细资料
TimerManagerAccessor
public TimerManagerAccessor()
已过时。
方法详细资料
setTimerManager
public void setTimerManager(TimerManager timerManager)
已过时。Specify the CommonJ TimerManager to delegate to.Note that the given TimerManager's lifecycle will be managed by this FactoryBean.
Alternatively (and typically), you can specify the JNDI name of the target TimerManager.
setTimerManagerName
public void setTimerManagerName(String timerManagerName)
已过时。Set the JNDI name of the CommonJ TimerManager.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".
setShared
public void setShared(boolean shared)
已过时。Specify whether the TimerManager obtained by this FactoryBean is a shared instance ("true") or an independent instance ("false"). The lifecycle of the former is supposed to be managed by the application server, while the lifecycle of the latter is up to the application.Default is "false", i.e. managing an independent TimerManager instance. This is what the CommonJ specification suggests that application servers are supposed to offer via JNDI lookups, typically declared as a
resource-ref
of typecommonj.timers.TimerManager
inweb.xml
, withres-sharing-scope
set to 'Unshareable'.Switch this flag to "true" if you are obtaining a shared TimerManager, typically through specifying the JNDI location of a TimerManager that has been explicitly declared as 'Shareable'. Note that WebLogic's cluster-aware Job Scheduler is a shared TimerManager too.
The sole difference between this FactoryBean being in shared or non-shared mode is that it will only attempt to suspend / resume / stop the underlying TimerManager in case of an independent (non-shared) instance. This only affects the
Lifecycle
support as well as application context shutdown.- 另请参阅:
stop()
,start()
,destroy()
,TimerManager
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
getTimerManager
@Nullable protected final TimerManager getTimerManager()
已过时。Return the configured TimerManager, if any.- 返回:
- the TimerManager, or
null
if not available
obtainTimerManager
protected TimerManager obtainTimerManager()
已过时。Obtain the TimerManager for actual use.- 返回:
- the TimerManager (never
null
) - 抛出:
IllegalStateException
- in case of no TimerManager set- 从以下版本开始:
- 5.0
start
public void start()
已过时。Resumes the underlying TimerManager (if not shared).- 指定者:
start
在接口中Lifecycle
- 另请参阅:
TimerManager.resume()
stop
public void stop()
已过时。Suspends the underlying TimerManager (if not shared).- 指定者:
stop
在接口中Lifecycle
- 另请参阅:
TimerManager.suspend()
isRunning
public boolean isRunning()
已过时。Considers the underlying TimerManager as running if it is neither suspending nor stopping.- 指定者:
isRunning
在接口中Lifecycle
- 返回:
- whether the component is currently running
- 另请参阅:
TimerManager.isSuspending()
,TimerManager.isStopping()
destroy
public void destroy()
已过时。Stops the underlying TimerManager (if not shared).- 指定者:
destroy
在接口中DisposableBean
- 另请参阅:
TimerManager.stop()