1 21 22 package org.apache.derby.impl.services.daemon; 23 24 import org.apache.derby.iapi.services.context.ContextService; 25 import org.apache.derby.iapi.services.daemon.DaemonFactory; 26 import org.apache.derby.iapi.services.daemon.DaemonService; 27 import org.apache.derby.impl.services.daemon.BasicDaemon; 28 import org.apache.derby.iapi.services.monitor.Monitor; 29 30 public class SingleThreadDaemonFactory implements DaemonFactory 31 { 32 private final ContextService contextService; 33 34 public SingleThreadDaemonFactory() 35 { 36 contextService = ContextService.getFactory(); 37 } 38 39 42 43 44 public DaemonService createNewDaemon(String name) 45 { 46 BasicDaemon daemon = new BasicDaemon(contextService); 47 48 Thread daemonThread = Monitor.getMonitor().getDaemonThread(daemon, name, false); 49 daemonThread.start(); 50 return daemon; 51 } 52 } 53 54 | Popular Tags |