adc 2004/07/31 08:05:12
Modified: modules/system/src/java/org/apache/geronimo/system/main CommandLine.java Daemon.java Log: Some nice messages that tell you when the server as completed startup. Revision Changes Path 1.7 +17 -1 incubator-geronimo/modules/system/src/java/org/apache/geronimo/system/main/CommandLine.java Index: CommandLine.java =================================================================== RCS file: /home/cvs/incubator-geronimo/modules/system/src/java/org/apache/geronimo/system/main/CommandLine.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- CommandLine.java 5 Apr 2004 05:54:11 -0000 1.6 +++ CommandLine.java 31 Jul 2004 15:05:12 -0000 1.7 @@ -22,6 +22,9 @@ import java.util.Iterator; import javax.management.ObjectName; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + import org.apache.geronimo.gbean.jmx.GBeanMBean; import org.apache.geronimo.kernel.Kernel; import org.apache.geronimo.kernel.config.Configuration; @@ -34,9 +37,12 @@ * @version $Revision$ $Date$ */ public class CommandLine { + private static Log log; + static { // This MUST be done before the first log is acquired GeronimoLogging.initialize(GeronimoLogging.ERROR); + log = LogFactory.getLog(CommandLine.class.getName()); // Install our url factory GeronimoURLFactory.install(); @@ -50,6 +56,9 @@ * @param args command line args */ public static void main(String[] args) { + + log.info("Server startup begun"); + try { // the interesting entries from the manifest CommandLineManifest manifest = CommandLineManifest.getManifestEntries(); @@ -78,6 +87,8 @@ kernel.startRecursiveGBean(configurationName); } + log.info("Server startup completed"); + // invoke the main method kernel.invoke( manifest.getMainGBean(), @@ -85,11 +96,16 @@ new Object[]{args}, new String[]{String[].class.getName()}); + log.info("Server shutdown begun"); + // stop this configuration kernel.stopGBean(configName); // shutdown the kernel kernel.shutdown(); + + log.info("Server shutdown completed"); + } catch (Exception e) { e.printStackTrace(); System.exit(2); 1.9 +13 -1 incubator-geronimo/modules/system/src/java/org/apache/geronimo/system/main/Daemon.java Index: Daemon.java =================================================================== RCS file: /home/cvs/incubator-geronimo/modules/system/src/java/org/apache/geronimo/system/main/Daemon.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- Daemon.java 13 Jul 2004 02:29:36 -0000 1.8 +++ Daemon.java 31 Jul 2004 15:05:12 -0000 1.9 @@ -26,6 +26,9 @@ import java.util.List; import javax.management.ObjectName; +import org.apache.commons.logging.LogFactory; +import org.apache.commons.logging.Log; + import org.apache.geronimo.gbean.jmx.GBeanMBean; import org.apache.geronimo.kernel.Kernel; import org.apache.geronimo.kernel.config.Configuration; @@ -40,9 +43,12 @@ * @version $Revision$ $Date$ */ public class Daemon { + private static Log log; + static { // This MUST be done before the first log is acquired GeronimoLogging.initialize(GeronimoLogging.INFO); + log = LogFactory.getLog(Daemon.class.getName()); // Install our url factory GeronimoURLFactory.install(); @@ -63,6 +69,9 @@ * @param args the command line arguments */ public static void main(String[] args) { + + log.info("Server startup begun"); + try { // get a list of the configuration uris from the command line List configs = new ArrayList(); @@ -104,7 +113,9 @@ final ObjectName configName = configurationManager.load(configuration, classLoader.getResource("/")); Runtime.getRuntime().addShutdownHook(new Thread("Shutdown Thread") { public void run() { + log.info("Server shutdown begun"); kernel.shutdown(); + log.info("Server shutdown completed"); } }); @@ -147,6 +158,7 @@ throw new AssertionError(); } + log.info("Server startup completed"); // capture this thread until the kernel is ready to exit while (kernel.isRunning()) {