geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r573678 - in /geronimo/sandbox/gshell/trunk: ./ gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/ gshell-cli/src/main/resources/META-INF/plexus/ gshell-command-api/src/main/java/org/apache/geronimo/gshell/command/ gshell-core/src/mai...
Date Fri, 07 Sep 2007 19:31:41 GMT
Author: jdillon
Date: Fri Sep  7 12:31:40 2007
New Revision: 573678

URL: http://svn.apache.org/viewvc?rev=573678&view=rev
Log:
Drop the testsuite for now, its not doing anything
Drop Banner
Tidy up some logging related muck

Added:
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/Slf4jLoggingManager.java
  (contents, props changed)
      - copied, changed from r573387, geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/PlexusLoggingAdapter.java
Removed:
    geronimo/sandbox/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Banner.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/PlexusLoggingAdapter.java
    geronimo/sandbox/gshell/trunk/gshell-testsuite/
Modified:
    geronimo/sandbox/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
    geronimo/sandbox/gshell/trunk/gshell-cli/src/main/resources/META-INF/plexus/plexus.xml
    geronimo/sandbox/gshell/trunk/gshell-command-api/src/main/java/org/apache/geronimo/gshell/command/CommandSupport.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/ShellImpl.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/PluginCollector.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/PluginDiscoverer.java
    geronimo/sandbox/gshell/trunk/pom.xml

Modified: geronimo/sandbox/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java?rev=573678&r1=573677&r2=573678&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
Fri Sep  7 12:31:40 2007
@@ -60,17 +60,14 @@
 
     private final IO io = new IO();
 
-    private final StopWatch watch = new StopWatch();
+    private final StopWatch watch = new StopWatch(true);
 
     public Main(final ClassWorld classWorld) {
         assert classWorld != null;
 
         this.classWorld = classWorld;
-
-        watch.start();
     }
 
-
     @Option(name="-h", aliases={"--help"}, description="Display this help message")
     private boolean help;
 
@@ -108,7 +105,6 @@
     @Option(name="-c", aliases={"--commands"}, description="Read commands from string")
     private String commands;
 
-    @SuppressWarnings({"MismatchedQueryAndUpdateOfCollection"})
     @Argument(description="Command")
     private List<String> args = new ArrayList<String>(0);
 
@@ -143,9 +139,6 @@
         clp.process(args);
 
         if (help) {
-            io.out.println(Banner.getBanner());
-
-            io.out.println();
             io.out.println(System.getProperty("program.name", "gshell") + " [options] <command>
[args]");
             io.out.println();
 
@@ -159,7 +152,6 @@
         }
 
         if (version) {
-            io.out.println(Banner.getBanner());
             io.out.println(Version.getInstance());
             io.out.println();
             io.out.flush();
@@ -197,10 +189,7 @@
         // Load the GShell instance
         final Shell shell = (Shell) container.lookup(Shell.class);
 
-        //
-        // TEMP: Log some info about the terminal
-        //
-
+        // Log some information about our terminal
         Terminal term = Terminal.getTerminal();
 
         log.debug("Using terminal: {}", term);
@@ -228,7 +217,7 @@
             Console.Executor executor = new Console.Executor() {
                 public Result execute(String line) throws Exception {
                     try {
-                        Object result = shell.execute(line);
+                        /* Object result =*/ shell.execute(line);
                     }
                     catch (ExitNotification n) {
                         return Result.STOP;
@@ -260,8 +249,6 @@
             result = shell.execute(args);
         }
 
-        log.debug("Ran for {}", watch);
-
         // If the result is a number, then pass that back to the calling shell
         int code = 0;
         
@@ -269,7 +256,7 @@
             code = ((Number)result).intValue();
         }
 
-        log.debug("Exiting with code: {}", code);
+        log.debug("Exiting with code: {}, after running for: {}", code, watch);
 
         return code;
     }

Modified: geronimo/sandbox/gshell/trunk/gshell-cli/src/main/resources/META-INF/plexus/plexus.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-cli/src/main/resources/META-INF/plexus/plexus.xml?rev=573678&r1=573677&r2=573678&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-cli/src/main/resources/META-INF/plexus/plexus.xml
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-cli/src/main/resources/META-INF/plexus/plexus.xml
Fri Sep  7 12:31:40 2007
@@ -25,6 +25,7 @@
         <listeners>
             <listener implementation="org.codehaus.plexus.component.discovery.DiscoveryListenerDescriptor">
                 <role>org.apache.geronimo.gshell.plugin.PluginCollector</role>
+                <role-hint>default</role-hint>
             </listener>
         </listeners>
 
@@ -34,13 +35,21 @@
     </component-discoverer-manager>
 
     <components>
+        <!--
+        Configure our logging component to be used so Plexus will pick it up.
+        -->
         <component>
             <role>org.codehaus.plexus.logging.LoggerManager</role>
-            <implementation>org.apache.geronimo.gshell.PlexusLoggingAdapter$LoggerManagerImpl</implementation>
+            <role-hint>default</role-hint>
+            <implementation>org.apache.geronimo.gshell.Slf4jLoggingManager</implementation>
         </component>
 
+        <!--
+        Configure the collector, needs to be done here since we are using it above as a discovery
listener.
+        -->
         <component>
             <role>org.apache.geronimo.gshell.plugin.PluginCollector</role>
+            <role-hint>default</role-hint>
             <implementation>org.apache.geronimo.gshell.plugin.PluginCollector</implementation>
         </component>
         

Modified: geronimo/sandbox/gshell/trunk/gshell-command-api/src/main/java/org/apache/geronimo/gshell/command/CommandSupport.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-command-api/src/main/java/org/apache/geronimo/gshell/command/CommandSupport.java?rev=573678&r1=573677&r2=573678&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-command-api/src/main/java/org/apache/geronimo/gshell/command/CommandSupport.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-command-api/src/main/java/org/apache/geronimo/gshell/command/CommandSupport.java
Fri Sep  7 12:31:40 2007
@@ -57,7 +57,7 @@
     public Object execute(final Object... args) throws Exception {
         assert args != null;
 
-        log.info("Executing w/arguments: {}", Arguments.asString(args));
+        log.info("Executing w/args: [{}]", Arguments.asString(args));
 
         Object result = null;
 

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/ShellImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/ShellImpl.java?rev=573678&r1=573677&r2=573678&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/ShellImpl.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/ShellImpl.java
Fri Sep  7 12:31:40 2007
@@ -89,7 +89,7 @@
         assert commandName != null;
         assert args != null;
 
-        log.info("Executing ({}): {}", commandName, Arguments.asString(args));
+        log.info("Executing ({}): [{}]", commandName, Arguments.asString(args));
 
         //
         // HACK: Probably need to pick a better way to name the command invocation container,
or do we even really need this?

Copied: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/Slf4jLoggingManager.java
(from r573387, geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/PlexusLoggingAdapter.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/Slf4jLoggingManager.java?p2=geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/Slf4jLoggingManager.java&p1=geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/PlexusLoggingAdapter.java&r1=573387&r2=573678&rev=573678&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/PlexusLoggingAdapter.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/Slf4jLoggingManager.java
Fri Sep  7 12:31:40 2007
@@ -19,31 +19,28 @@
 
 package org.apache.geronimo.gshell;
 
+import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.logging.AbstractLogger;
 import org.codehaus.plexus.logging.BaseLoggerManager;
+import org.codehaus.plexus.logging.LoggerManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Adapts the Plexus logging system to GShell.
+ * Adapts the Plexus logging system to SLF4J.
  *
  * @version $Rev$ $Date$
  */
-public class PlexusLoggingAdapter
+@Component(role=LoggerManager.class, hint="slf4j")
+public class Slf4jLoggingManager
+    extends BaseLoggerManager
 {
-    /**
-     * Adapts the Plexus {@link org.codehaus.plexus.logging.LoggerManager} interface to the
GShell interface.
-     */
-    public static class LoggerManagerImpl
-        extends BaseLoggerManager
-    {
-        protected org.codehaus.plexus.logging.Logger createLogger(final String key) {
-            return new LoggerImpl(getThreshold(), LoggerFactory.getLogger(key));
-        }
+    protected org.codehaus.plexus.logging.Logger createLogger(final String key) {
+        return new LoggerImpl(getThreshold(), LoggerFactory.getLogger(key));
     }
-    
+
     /**
-     * Adapts the Plexus {@link org.codehaus.plexus.logging.Logger} interface to the GShell
interface.
+     * Adapts the Plexus {@link org.codehaus.plexus.logging.Logger} interface to SLF4J
      */
     public static class LoggerImpl
         extends AbstractLogger

Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/Slf4jLoggingManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/Slf4jLoggingManager.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/Slf4jLoggingManager.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/PluginCollector.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/PluginCollector.java?rev=573678&r1=573677&r2=573678&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/PluginCollector.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/PluginCollector.java
Fri Sep  7 12:31:40 2007
@@ -37,7 +37,7 @@
  * 
  * @version $Rev$ $Date$
  */
-@Component(role=ComponentDiscoveryListener.class, hint="gshell")
+@Component(role=PluginCollector.class)
 public class PluginCollector
     implements ComponentDiscoveryListener
 {

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/PluginDiscoverer.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/PluginDiscoverer.java?rev=573678&r1=573677&r2=573678&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/PluginDiscoverer.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/PluginDiscoverer.java
Fri Sep  7 12:31:40 2007
@@ -34,7 +34,7 @@
  *
  * @version $Rev$ $Date$
  */
-@Component(role=ComponentDiscoverer.class, hint="gshell")
+@Component(role=ComponentDiscoverer.class)
 public class PluginDiscoverer
     extends AbstractComponentDiscoverer
 {

Modified: geronimo/sandbox/gshell/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/pom.xml?rev=573678&r1=573677&r2=573678&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/pom.xml Fri Sep  7 12:31:40 2007
@@ -341,7 +341,6 @@
         <module>gshell-maven-plugin</module>
         <module>gshell-cli</module>
         <module>gshell-commands</module>
-        <module>gshell-testsuite</module>
         <module>gshell-assembly</module>
     </modules>
     



Mime
View raw message