public class SingletonTimerFactory extends java.lang.Object implements TimerFactory, ModuleControl
TimerFactory
,
ModuleControl
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.atomic.AtomicInteger |
cancelCount
The number of times
cancel(TimerTask) has been called. |
private java.util.Timer |
singletonTimer
Singleton Timer instance.
|
private java.lang.StringBuilder |
warnings
Initialization warnings.
|
Constructor and Description |
---|
SingletonTimerFactory()
Initializes this TimerFactory with a singleton Timer instance.
|
Modifier and Type | Method and Description |
---|---|
void |
boot(boolean create,
java.util.Properties properties)
Currently does nothing, singleton Timer instance is initialized
in the constructor.
|
void |
cancel(java.util.TimerTask task)
Cancel a task.
|
private java.lang.ClassLoader |
getContextClassLoader()
Check if the current context class loader could cause a memory leak
(DERBY-3745) if it is inherited by the timer thread, and return it if
that is the case.
|
java.lang.String |
getWarnings()
Return any warnings generated during the initialization of this class, or
null if none
|
private void |
report(java.lang.SecurityException se,
java.lang.String id) |
void |
schedule(java.util.TimerTask task,
long delay)
Schedule a task.
|
private void |
setContextClassLoader(java.lang.ClassLoader cl) |
void |
stop()
Cancels the singleton Timer instance.
|
private final java.util.Timer singletonTimer
private final java.util.concurrent.atomic.AtomicInteger cancelCount
cancel(TimerTask)
has been called.
Used for determining whether it's time to purge cancelled tasks from
the timer.private java.lang.StringBuilder warnings
getWarnings()
.public SingletonTimerFactory()
public void schedule(java.util.TimerTask task, long delay)
TimerFactory
schedule
in interface TimerFactory
task
- the task to scheduledelay
- how many milliseconds to wait before executing the taskpublic void cancel(java.util.TimerTask task)
TimerFactory
cancel
in interface TimerFactory
task
- the task to cancelpublic void boot(boolean create, java.util.Properties properties) throws StandardException
boot
in interface ModuleControl
create
- not usedproperties
- not usedStandardException
- not usedModuleControl
public void stop()
stop
in interface ModuleControl
ModuleControl
private java.lang.ClassLoader getContextClassLoader()
null
otherwiseprivate void setContextClassLoader(java.lang.ClassLoader cl)
private void report(java.lang.SecurityException se, java.lang.String id)
public java.lang.String getWarnings()
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.