1 21 22 package org.apache.derby.impl.services.timer; 23 24 import org.apache.derby.iapi.services.timer.TimerFactory; 25 import org.apache.derby.iapi.services.monitor.ModuleControl; 26 27 import org.apache.derby.iapi.error.StandardException; 28 29 import java.util.Timer ; 30 import java.util.Properties ; 31 32 33 43 public class SingletonTimerFactory 44 implements 45 TimerFactory, 46 ModuleControl 47 { 48 51 private Timer singletonTimer; 52 53 56 public SingletonTimerFactory() 57 { 58 64 singletonTimer = new Timer (true); } 66 67 77 public Timer getCancellationTimer() 78 { 79 return singletonTimer; 80 } 81 82 90 public void boot(boolean create, Properties properties) 91 throws 92 StandardException 93 { 94 } 96 97 104 public void stop() 105 { 106 singletonTimer.cancel(); 107 } 108 } 109 | Popular Tags |