1 16 17 package org.apache.jetspeed.services.daemonfactory; 18 19 import org.apache.jetspeed.daemon.Daemon; 20 import org.apache.jetspeed.daemon.DaemonEntry; 21 import org.apache.jetspeed.daemon.DaemonContext; 22 import org.apache.jetspeed.daemon.DaemonException; 23 import org.apache.jetspeed.daemon.DaemonNotFoundException; 24 import org.apache.turbine.services.TurbineServices; 25 26 30 public class DaemonFactory { 31 32 protected static final DaemonFactoryService getService() { 33 return (DaemonFactoryService)TurbineServices 34 .getInstance() 35 .getService(DaemonFactoryService.SERVICE_NAME); 36 } 37 38 49 public static void start() { 50 getService().start(); 51 } 52 53 57 public static Daemon getDaemon( DaemonEntry entry ) throws DaemonException { 58 return getService().getDaemon( entry ); 59 } 60 61 66 public static Daemon getDaemon( String classname ) throws DaemonException { 67 return getService().getDaemon( classname ); 68 } 69 70 72 public static DaemonContext getDaemonContext() { 73 return getService().getDaemonContext(); 74 } 75 76 80 public static void process( DaemonEntry entry ) throws DaemonException { 81 getService().process( entry ); 82 } 83 84 86 public static int getStatus(DaemonEntry entry) { 87 return getService().getStatus( entry ); 88 } 89 90 93 public static int getResult(DaemonEntry entry) { 94 return getService().getResult( entry ); 95 } 96 97 100 public static String getMessage( DaemonEntry entry ) { 101 return getService().getMessage( entry ); 102 } 103 104 107 public static DaemonEntry[] getDaemonEntries() { 108 return getService().getDaemonEntries(); 109 } 110 111 114 public static DaemonEntry getDaemonEntry(String name) 115 throws DaemonNotFoundException { 116 return getService().getDaemonEntry( name ); 117 } 118 119 } 120 | Popular Tags |