org.apache.derby.impl.services.timer
Class SingletonTimerFactory

java.lang.Object
  extended by org.apache.derby.impl.services.timer.SingletonTimerFactory
All Implemented Interfaces:
ModuleControl, TimerFactory

public class SingletonTimerFactory
extends java.lang.Object
implements TimerFactory, ModuleControl

This class implements the TimerFactory interface. It creates a singleton Timer instance. The class implements the ModuleControl interface, because it needs to cancel the Timer at system shutdown.

See Also:
TimerFactory, ModuleControl

Field Summary
private  java.util.Timer singletonTimer
          Singleton Timer instance.
 
Constructor Summary
SingletonTimerFactory()
          Initializes this TimerFactory with a singleton Timer instance.
 
Method Summary
 void boot(boolean create, java.util.Properties properties)
          Currently does nothing, singleton Timer instance is initialized in the constructor.
 java.util.Timer getCancellationTimer()
          Returns a Timer object that can be used for adding TimerTasks that cancel executing statements.
 void stop()
          Cancels the singleton Timer instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

singletonTimer

private java.util.Timer singletonTimer
Singleton Timer instance.

Constructor Detail

SingletonTimerFactory

public SingletonTimerFactory()
Initializes this TimerFactory with a singleton Timer instance.

Method Detail

getCancellationTimer

public java.util.Timer getCancellationTimer()
Returns a Timer object that can be used for adding TimerTasks that cancel executing statements. Implements the TimerFactory interface.

Specified by:
getCancellationTimer in interface TimerFactory
Returns:
a Timer object for cancelling statements.
See Also:
TimerFactory

boot

public void boot(boolean create,
                 java.util.Properties properties)
          throws StandardException
Currently does nothing, singleton Timer instance is initialized in the constructor. Implements the ModuleControl interface.

Specified by:
boot in interface ModuleControl
Throws:
StandardException - Module cannot be started.
See Also:
ModuleControl

stop

public void stop()
Cancels the singleton Timer instance. Implements the ModuleControl interface.

Specified by:
stop in interface ModuleControl
See Also:
ModuleControl

Built on Thu 2011-03-10 11:54:14+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.