CVS: jcontainer/loom/launcher/src/java/org/jcontainer/loom/launcher DaemonLauncher.java,1.3,1.4 LauncherUtils.java,1.5,1.6 Main.java,1.6,1.7
Peter Donald <pdonald-yCVjj/[email protected]> Sat, 29 Nov 2003 07:50:53 -0600
| Newsgroups | gmane.comp.java.jcontainer.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/jcontainer/jcontainer/loom/launcher/src/java/org/jcontainer/loom/launcher In directory hogshead.codehaus.org:/tmp/cvs-serv32251/loom/launcher/src/java/org/jcontainer/loom/launcher Modified Files: DaemonLauncher.java LauncherUtils.java Main.java Log Message: Remove email addie Index: DaemonLauncher.java =================================================================== RCS file: /cvsroot/jcontainer/jcontainer/loom/launcher/src/java/org/jcontainer/loom/launcher/DaemonLauncher.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- DaemonLauncher.java 17 Aug 2003 18:27:33 -0000 1.3 +++ DaemonLauncher.java 29 Nov 2003 13:50:50 -0000 1.4 @@ -89,26 +89,25 @@ import java.util.Hashtable; import java.util.Observable; import java.util.Observer; - import org.tanukisoftware.wrapper.WrapperListener; import org.tanukisoftware.wrapper.WrapperManager; /** - * A frontend for Phoenix that starts it as a native service - * using the Java Service Wrapper at http://wrapper.tanukisoftware.org + * A frontend for Phoenix that starts it as a native service using the Java + * Service Wrapper at http://wrapper.tanukisoftware.org * - * @author <a href="mailto:peter at apache.org">Peter Donald</a> + * @author Peter Donald * @author <a href="mailto:[email protected]">Leif Mortenson</a> */ public class DaemonLauncher implements WrapperListener, Observer { /** - * In order to avoid calling the Wrapper stop method recursively, we need - * to keep track of whether or not the Wrapper already knows we are - * stopping. Necessary because of the way the shutdown process in - * Phoenix works. Ideally, we would unregister this Observer with - * CLIMain but we can't do that for security reasons. + * In order to avoid calling the Wrapper stop method recursively, we need to + * keep track of whether or not the Wrapper already knows we are stopping. + * Necessary because of the way the shutdown process in Phoenix works. + * Ideally, we would unregister this Observer with CLIMain but we can't do + * that for security reasons. */ private boolean m_ignoreUpdates = false; @@ -117,15 +116,13 @@ *-------------------------------------------------------------*/ /** * The start method is called when the WrapperManager is signaled by the - * native wrapper code that it can start its application. This - * method call is expected to return, so a new thread should be launched - * if necessary. + * native wrapper code that it can start its application. This method call + * is expected to return, so a new thread should be launched if necessary. * * @param args List of arguments used to initialize the application. - * - * @return Any error code if the application should exit on completion - * of the start method. If there were no problems then this - * method should return null. + * @return Any error code if the application should exit on completion of + * the start method. If there were no problems then this method + * should return null. */ public Integer start( final String[] args ) { @@ -169,15 +166,14 @@ /** * Called when the application is shutting down. The Wrapper assumes that - * this method will return fairly quickly. If the shutdown code code - * could potentially take a long time, then WrapperManager.stopping() - * should be called to extend the timeout period. If for some reason, - * the stop method can not return, then it must call - * WrapperManager.stopped() to avoid warning messages from the Wrapper. + * this method will return fairly quickly. If the shutdown code code could + * potentially take a long time, then WrapperManager.stopping() should be + * called to extend the timeout period. If for some reason, the stop method + * can not return, then it must call WrapperManager.stopped() to avoid + * warning messages from the Wrapper. * * @param exitCode The suggested exit code that will be returned to the OS - * when the JVM exits. - * + * when the JVM exits. * @return The exit code to actually return to the OS. In most cases, this * should just be the value of exitCode, however the user code has * the option of changing the exit code if there are any problems @@ -194,10 +190,10 @@ /** * Called whenever the native wrapper code traps a system control signal - * against the Java process. It is up to the callback to take any actions - * necessary. Possible values are: WrapperManager.WRAPPER_CTRL_C_EVENT, - * WRAPPER_CTRL_CLOSE_EVENT, WRAPPER_CTRL_LOGOFF_EVENT, or - * WRAPPER_CTRL_SHUTDOWN_EVENT + * against the Java process. It is up to the callback to take any actions + * necessary. Possible values are: WrapperManager.WRAPPER_CTRL_C_EVENT, + * WRAPPER_CTRL_CLOSE_EVENT, WRAPPER_CTRL_LOGOFF_EVENT, or + * WRAPPER_CTRL_SHUTDOWN_EVENT * * @param event The system control signal. */ @@ -207,7 +203,8 @@ { if( WrapperManager.isDebugEnabled() ) { - System.out.println( "DaemonLauncher: controlEvent(" + event + ") - Ignored." ); + System.out.println( + "DaemonLauncher: controlEvent(" + event + ") - Ignored." ); } // This application ignores all incoming control events. @@ -217,7 +214,8 @@ { if( WrapperManager.isDebugEnabled() ) { - System.out.println( "DaemonLauncher: controlEvent(" + event + ") - Stopping." ); + System.out.println( + "DaemonLauncher: controlEvent(" + event + ") - Stopping." ); } // Not being run under a wrapper, so this isn't an NT service and should always exit. @@ -231,10 +229,10 @@ * Methods *-------------------------------------------------------------*/ /** - * We use an Observer rather than operating on some more meaningful - * event system as Observer and friends can be loaded from system - * ClassLoader and thus the Embeddor does not have to share a common - * classloader ancestor with invoker + * We use an Observer rather than operating on some more meaningful event + * system as Observer and friends can be loaded from system ClassLoader and + * thus the Embeddor does not have to share a common classloader ancestor + * with invoker */ public void update( final Observable observable, final Object arg ) { @@ -243,8 +241,10 @@ // Ignore this update if( WrapperManager.isDebugEnabled() ) { - System.out.println( "DaemonLauncher: " + arg - + " request ignored because stop already called." ); + System.out.println( + "DaemonLauncher: " + + arg + + " request ignored because stop already called." ); System.out.flush(); } } @@ -287,7 +287,8 @@ } else { - throw new IllegalArgumentException( "Unknown action " + command ); + throw new IllegalArgumentException( + "Unknown action " + command ); } } } Index: LauncherUtils.java =================================================================== RCS file: /cvsroot/jcontainer/jcontainer/loom/launcher/src/java/org/jcontainer/loom/launcher/LauncherUtils.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- LauncherUtils.java 3 Nov 2003 04:55:14 -0000 1.5 +++ LauncherUtils.java 29 Nov 2003 13:50:50 -0000 1.6 @@ -92,10 +92,9 @@ import java.util.StringTokenizer; /** - * A set of utilities that help when writing - * Launchers. + * A set of utilities that help when writing Launchers. * - * @author <a href="mailto:peter at apache.org">Peter Donald</a> + * @author Peter Donald */ public class LauncherUtils { @@ -135,19 +134,20 @@ final String libDirectory ) throws Exception { - final String engineLibDir = libDirectory.replace( '/', File.separatorChar ); + final String engineLibDir = libDirectory.replace( '/', + File.separatorChar ); final File dir = new File( homeDir, engineLibDir ).getCanonicalFile(); if( !dir.exists() ) { - throw new Exception( "Unable to locate library directory at " + engineLibDir ); + throw new Exception( + "Unable to locate library directory at " + engineLibDir ); } return dir; } /** - * Utility method to find the home directory - * of Loom and make sure system property is - * set to it. + * Utility method to find the home directory of Loom and make sure system + * property is set to it. * * @return the location of loom directory * @throws Exception if unable to locate directory @@ -170,7 +170,7 @@ } /** - * Finds the loaderJar file in the classpath. + * Finds the loaderJar file in the classpath. */ private static final File findLoaderDir( final String systemProperty, final String loaderJar ) @@ -178,7 +178,8 @@ { final String classpath = System.getProperty( "java.class.path" ); final String pathSeparator = System.getProperty( "path.separator" ); - final StringTokenizer tokenizer = new StringTokenizer( classpath, pathSeparator ); + final StringTokenizer tokenizer = new StringTokenizer( classpath, + pathSeparator ); while( tokenizer.hasMoreTokens() ) { @@ -192,7 +193,8 @@ } } - throw new Exception( "Unable to locate " + loaderJar + + throw new Exception( "Unable to locate " + + loaderJar + " in classpath. User must specify " + systemProperty + " system property." ); } Index: Main.java =================================================================== RCS file: /cvsroot/jcontainer/jcontainer/loom/launcher/src/java/org/jcontainer/loom/launcher/Main.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Main.java 3 Nov 2003 05:52:13 -0000 1.6 +++ Main.java 29 Nov 2003 13:50:50 -0000 1.7 @@ -95,10 +95,10 @@ import java.util.Map; /** - * LoomLoader is the class that bootstraps and sets up engine ClassLoader. - * It also sets up a default policy that gives full permissions to engine code. + * LoomLoader is the class that bootstraps and sets up engine ClassLoader. It + * also sets up a default policy that gives full permissions to engine code. * - * @author <a href="mailto:peter at apache.org">Peter Donald</a> + * @author Peter Donald */ public final class Main { @@ -120,14 +120,12 @@ } /** - * Method to call to startup Loom from an - * external (calling) application. Protected to allow - * access from DaemonLauncher. + * Method to call to startup Loom from an external (calling) application. + * Protected to allow access from DaemonLauncher. * * @param options the command line arg array * @param data a set of extra parameters to pass to embeddor * @param blocking false if the current thread is expected to return. - * * @return the exit code which should be used to exit the JVM */ protected static final int startup( final String[] options, @@ -148,8 +146,10 @@ LauncherUtils.generateClassPath( homeDir, "container/lib" ); final URLClassLoader classLoader = new URLClassLoader( urls ); - data.put( ClassLoader.class.getName() + "/common", ClassLoader.getSystemClassLoader() ); - data.put( ClassLoader.class.getName() + "/container", classLoader ); + data.put( ClassLoader.class.getName() + "/common", + ClassLoader.getSystemClassLoader() ); + data.put( ClassLoader.class.getName() + "/container", + classLoader ); data.put( File.class.getName() + "/home", homeDir ); //Setup context classloader @@ -195,9 +195,8 @@ } /** - * Method to call to shutdown Loom from an - * external (calling) application. Protected to allow - * access from DaemonLauncher. + * Method to call to shutdown Loom from an external (calling) application. + * Protected to allow access from DaemonLauncher. */ protected static final void shutdown() { @@ -224,7 +223,8 @@ try { final Class clazz = frontend.getClass(); - final Method method = clazz.getMethod( "shutdown", new Class[ 0 ] ); + final Method method = clazz.getMethod( "shutdown", + new Class[ 0 ] ); //Lets put this sucker to sleep method.invoke( frontend, new Object[ 0 ] );