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.
|
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 static java.lang.ClassLoader |
getContextClassLoader() |
void |
schedule(java.util.TimerTask task,
long delay)
Schedule a task.
|
private static void |
setContextClassLoader(java.lang.ClassLoader cl) |
void |
stop()
Cancels the singleton Timer instance.
|
private 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.public SingletonTimerFactory()
public void schedule(java.util.TimerTask task, long delay)
schedule
in interface TimerFactory
task
- the task to scheduledelay
- how many milliseconds to wait before executing the taskpublic void cancel(java.util.TimerTask task)
cancel
in interface TimerFactory
task
- the task to cancelpublic void boot(boolean create, java.util.Properties properties) throws StandardException
boot
in interface ModuleControl
StandardException
- Module cannot be started.ModuleControl
public void stop()
stop
in interface ModuleControl
ModuleControl
private static java.lang.ClassLoader getContextClassLoader()
private static void setContextClassLoader(java.lang.ClassLoader cl)
Apache Derby V10.11 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.