geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r670187 - in /geronimo/gshell/trunk: gshell-api/src/main/java/org/apache/geronimo/gshell/command/ gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/ gshell-plugin/src/main/java/org/apache/geronimo/gs...
Date Sat, 21 Jun 2008 12:17:15 GMT
Author: jdillon
Date: Sat Jun 21 05:17:14 2008
New Revision: 670187

URL: http://svn.apache.org/viewvc?rev=670187&view=rev
Log:
Tidy up after last refactoring wave

Modified:
    geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java
    geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandContainer.java
    geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpCommand.java
    geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/descriptor/CommandContainerDescriptor.java
    geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommandLineExecutor.java
    geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommandResolver.java

Modified: geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java?rev=670187&r1=670186&r2=670187&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java
(original)
+++ geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java
Sat Jun 21 05:17:14 2008
@@ -25,7 +25,10 @@
  * @version $Rev$ $Date$
  */
 public interface Command
-    extends CommandContainer
 {
+    CommandContainer getContainer();
+
     CommandInfo getInfo();
+
+    CommandResult execute(CommandContext context);
 }
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandContainer.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandContainer.java?rev=670187&r1=670186&r2=670187&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandContainer.java
(original)
+++ geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandContainer.java
Sat Jun 21 05:17:14 2008
@@ -32,7 +32,7 @@
      * @return  The command identifier; never null;
      */
     String getId();
-    
+
     /**
      * Returns the action of the command.
      *

Modified: geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpCommand.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpCommand.java?rev=670187&r1=670186&r2=670187&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpCommand.java
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpCommand.java
Sat Jun 21 05:17:14 2008
@@ -185,16 +185,16 @@
         }
     }
 
-    private void displayCommandManual(final String command, final ShellContext context) throws
CommandException {
-        assert command != null;
+    private void displayCommandManual(final String path, final ShellContext context) throws
CommandException {
+        assert path != null;
         assert context != null;
 
         IO io = context.getIo();
 
-        Command cmd = commandResolver.resolve(context, command);
+        Command command = commandResolver.resolve(context, path);
 
-        CommandDocumenter documenter = cmd.getDocumenter();
-        CommandInfo info = cmd.getInfo();
+        CommandDocumenter documenter = command.getContainer().getDocumenter();
+        CommandInfo info = command.getInfo();
 
         log.debug("Rendering help for command: {}", info.getName());
 

Modified: geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/descriptor/CommandContainerDescriptor.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/descriptor/CommandContainerDescriptor.java?rev=670187&r1=670186&r2=670187&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/descriptor/CommandContainerDescriptor.java
(original)
+++ geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/descriptor/CommandContainerDescriptor.java
Sat Jun 21 05:17:14 2008
@@ -20,12 +20,11 @@
 package org.apache.geronimo.gshell.plugin.descriptor;
 
 import org.apache.geronimo.gshell.model.command.CommandModel;
-import org.apache.geronimo.gshell.command.Command;
 import org.apache.geronimo.gshell.command.CommandContainer;
 import org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration;
 
 /**
- * Descriptor for a {@link Command} Plexus component.
+ * Descriptor for a {@link CommandContainer} Plexus component.
  *
  * @version $Rev$ $Date$
  */

Modified: geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommandLineExecutor.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommandLineExecutor.java?rev=670187&r1=670186&r2=670187&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommandLineExecutor.java
(original)
+++ geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommandLineExecutor.java
Sat Jun 21 05:17:14 2008
@@ -60,7 +60,7 @@
  *
  * @version $Rev$ $Date$
  */
-@Component(role= CommandLineExecutor.class)
+@Component(role=CommandLineExecutor.class)
 public class DefaultCommandLineExecutor
     implements CommandLineExecutor, Initializable
 {

Modified: geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommandResolver.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommandResolver.java?rev=670187&r1=670186&r2=670187&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommandResolver.java
(original)
+++ geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommandResolver.java
Sat Jun 21 05:17:14 2008
@@ -20,16 +20,13 @@
 package org.apache.geronimo.gshell.rapture;
 
 import org.apache.geronimo.gshell.command.Command;
-import org.apache.geronimo.gshell.command.CommandAction;
-import org.apache.geronimo.gshell.command.CommandCompleter;
 import org.apache.geronimo.gshell.command.CommandContainer;
 import org.apache.geronimo.gshell.command.CommandContainerFactory;
-import org.apache.geronimo.gshell.command.CommandContext;
-import org.apache.geronimo.gshell.command.CommandDocumenter;
 import org.apache.geronimo.gshell.command.CommandInfo;
 import org.apache.geronimo.gshell.command.CommandNotFoundException;
 import org.apache.geronimo.gshell.command.CommandResolver;
 import org.apache.geronimo.gshell.command.CommandResult;
+import org.apache.geronimo.gshell.command.CommandContext;
 import org.apache.geronimo.gshell.layout.LayoutManager;
 import org.apache.geronimo.gshell.layout.NotFoundException;
 import org.apache.geronimo.gshell.model.layout.AliasNode;
@@ -90,9 +87,9 @@
 
         assert containerFactory != null;
         
-        final CommandContainer command;
+        final CommandContainer container;
         try {
-            command = containerFactory.create(id);
+            container = containerFactory.create(id);
         }
         catch (Exception e) {
             throw new CommandNotFoundException(e);
@@ -105,26 +102,12 @@
                 return new DefaultCommandInfo(node);
             }
 
-            // Proxy everything else...
-            
-            public String getId() {
-                return command.getId();
-            }
-
-            public CommandAction getAction() {
-                return command.getAction();
-            }
-
-            public CommandDocumenter getDocumenter() {
-                return command.getDocumenter();
-            }
-
-            public CommandCompleter getCompleter() {
-                return command.getCompleter();
+            public CommandContainer getContainer() {
+                return container;
             }
 
             public CommandResult execute(CommandContext context) {
-                return command.execute(context);
+                return container.execute(context);
             }
         };
     }



Mime
View raw message