CVS: jcontainer/loom/engine/src/java/org/jcontainer/loom/frontends CLIMain.java,1.16,1.17 CLISetup.java,1.6,1.7

Peter Donald <pdonald-yCVjj/[email protected]>
Newsgroups gmane.comp.java.jcontainer.cvs
Message-ID <[email protected]>
Update of /cvsroot/jcontainer/jcontainer/loom/engine/src/java/org/jcontainer/loom/frontends
In directory hogshead.codehaus.org:/tmp/cvs-serv25270/engine/src/java/org/jcontainer/loom/frontends

Modified Files:
	CLIMain.java CLISetup.java 
Log Message:
Move all deployment management into DefaultDeploymentMonitor


Index: CLIMain.java
===================================================================
RCS file: /cvsroot/jcontainer/jcontainer/loom/engine/src/java/org/jcontainer/loom/frontends/CLIMain.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- CLIMain.java	29 Oct 2003 21:55:27 -0000	1.16
+++ CLIMain.java	29 Oct 2003 22:46:17 -0000	1.17
@@ -124,7 +124,6 @@
     private static final Resources REZ =
         ResourceManager.getPackageResources( CLIMain.class );
 
-    static final String APPS_DIR = File.class.getName() + "/apps";
     static final String HOME_DIR = File.class.getName() + "/home";
     static final String PERSISTENT = Boolean.class.getName() + "/persistent";
     static final String DISABLE_HOOK = "disable-hook";
@@ -133,9 +132,6 @@
     private static final String DEFAULT_LOG_FILE =
         File.separator + "logs" + File.separator + "loom.log";
 
-    private static final String DEFAULT_APPS_DIR =
-        File.separator + "apps";
-
     private static final String DEFAULT_CONF_FILE =
         File.separator + "conf" + File.separator + "kernel.xml";
 
@@ -155,6 +151,7 @@
     private Logger m_logger;
 
     private File m_home;
+    private FileTarget m_logTarget;
 
     /**
      * Main entry point.
@@ -193,18 +190,6 @@
                 properties.setProperty( CONFIGFILE,
                                         configFile.toString() );
             }
-            final String appsPath;
-            if( !properties.containsKey( APPS_DIR ) )
-            {
-                appsPath = m_home + DEFAULT_APPS_DIR;
-            }
-            else
-            {
-                appsPath = properties.getProperty( APPS_DIR );
-            }
-            final File appsDirFile =
-                new File( appsPath ).getCanonicalFile();
-            data.put( APPS_DIR, appsDirFile );
 
             final Boolean persistent;
             if( !properties.containsKey( PERSISTENT ) )
@@ -226,6 +211,7 @@
             handleException( throwable );
         }
 
+        m_logTarget.close();
         return m_exitCode;
     }
 
@@ -352,13 +338,13 @@
             properties.getProperty( "log-priority", "INFO" );
         final ExtendedPatternFormatter formatter = new ExtendedPatternFormatter( DEFAULT_FORMAT );
         final File file = new File( logDestination );
-        final FileTarget logTarget = new FileTarget( file, false, formatter );
+        m_logTarget = new FileTarget( file, false, formatter );
 
         //Create an anonymous hierarchy so no other
         //components can get access to logging hierarchy
         final Hierarchy hierarchy = new Hierarchy();
         final org.apache.log.Logger logger = hierarchy.getLoggerFor( "Loom" );
-        logger.setLogTargets( new LogTarget[]{logTarget} );
+        logger.setLogTargets( new LogTarget[]{m_logTarget} );
         logger.setPriority( Priority.getPriorityForName( logPriority ) );
         logger.info( "Logger started" );
         return new LogkitLogger( logger );
@@ -445,16 +431,21 @@
     private void handleException( final Throwable throwable )
     {
         System.out.println( REZ.getString( "main.exception.header" ) );
-        final String trace =
-            ExceptionUtil.prettyPrintStackTrace( throwable,
-                                                 "org.jcontainer.loom.components" );
-        System.out.println( trace );
-        System.out.println( REZ.getString( "main.exception.footer" ) );
-
+        final String trace;
         if( null != m_logger )
         {
+            trace =
+                ExceptionUtil.prettyPrintStackTrace( throwable,
+                                                     "org.jcontainer.loom.components" );
             m_logger.error( throwable.getMessage(), throwable );
         }
+        else
+        {
+            trace = ExceptionUtil.printStackTrace( throwable );
+        }
+        System.out.println( trace );
+        System.out.println( REZ.getString( "main.exception.footer" ) );
+
         m_exitCode = 1;
     }
 }

Index: CLISetup.java
===================================================================
RCS file: /cvsroot/jcontainer/jcontainer/loom/engine/src/java/org/jcontainer/loom/frontends/CLISetup.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- CLISetup.java	29 Oct 2003 21:55:27 -0000	1.6
+++ CLISetup.java	29 Oct 2003 22:46:17 -0000	1.7
@@ -109,7 +109,6 @@
     private static final int DEBUG_LOG_OPT = 'd';
     private static final int HELP_OPT = 'h';
     private static final int LOG_FILE_OPT = 'l';
-    private static final int APPS_PATH_OPT = 'a';
     private static final int PERSISTENT_OPT = 'p';
     private static final int CONFIGFILE_OPT = 'f';
     private static final int DISABLE_HOOK_OPT = 2;
@@ -140,7 +139,7 @@
      */
     private CLOptionDescriptor[] createCLOptions()
     {
-        final CLOptionDescriptor options[] = new CLOptionDescriptor[ 7 ];
+        final CLOptionDescriptor options[] = new CLOptionDescriptor[ 6 ];
         options[ 0 ] =
             new CLOptionDescriptor( "help",
                                     CLOptionDescriptor.ARGUMENT_DISALLOWED,
@@ -152,26 +151,21 @@
                                     LOG_FILE_OPT,
                                     REZ.getString( "cli.opt.log-file.desc" ) );
         options[ 2 ] =
-            new CLOptionDescriptor( "apps-path",
-                                    CLOptionDescriptor.ARGUMENT_REQUIRED,
-                                    APPS_PATH_OPT,
-                                    REZ.getString( "cli.opt.apps-path.desc" ) );
-        options[ 3 ] =
             new CLOptionDescriptor( "debug-init",
                                     CLOptionDescriptor.ARGUMENT_DISALLOWED,
                                     DEBUG_LOG_OPT,
                                     REZ.getString( "cli.opt.debug-init.desc" ) );
-        options[ 4 ] =
+        options[ 3 ] =
             new CLOptionDescriptor( "disable-hook",
                                     CLOptionDescriptor.ARGUMENT_DISALLOWED,
                                     DISABLE_HOOK_OPT,
                                     REZ.getString( "cli.opt.disable-hook.desc" ) );
-        options[ 5 ] =
+        options[ 4 ] =
             new CLOptionDescriptor( "persistent",
                                     CLOptionDescriptor.ARGUMENT_DISALLOWED,
                                     PERSISTENT_OPT,
                                     REZ.getString( "cli.opt.persistent.desc" ) );
-        options[ 6 ] =
+        options[ 5 ] =
             new CLOptionDescriptor( "configfile",
                                     CLOptionDescriptor.ARGUMENT_REQUIRED,
                                     CONFIGFILE_OPT,
@@ -223,11 +217,6 @@
 
                 case LOG_FILE_OPT:
                     m_parameters.setProperty( "log-destination", option.getArgument() );
-                    break;
-
-                case APPS_PATH_OPT:
-                    m_parameters.setProperty( CLIMain.APPS_DIR,
-                                              option.getArgument() );
                     break;
 
                 case PERSISTENT_OPT:
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.