geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r697876 - in /geronimo/gshell/trunk: gshell-api/src/main/java/org/apache/geronimo/gshell/command/ gshell-commands/gshell-admin/src/main/resources/META-INF/spring/ gshell-commands/gshell-bsf/src/main/resources/META-INF/spring/ gshell-command...
Date Mon, 22 Sep 2008 16:00:31 GMT
Author: jdillon
Date: Mon Sep 22 09:00:31 2008
New Revision: 697876

URL: http://svn.apache.org/viewvc?rev=697876&view=rev
Log:
Dropped Command.getId() as it was mostly meaningless
Changed all command plugins to use new stateful/stateless muck, dropped older commandTemplate

Modified:
    geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java
    geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/META-INF/spring/components.xml
    geronimo/gshell/trunk/gshell-commands/gshell-bsf/src/main/resources/META-INF/spring/components.xml
    geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/META-INF/spring/components.xml
    geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/META-INF/spring/components.xml
    geronimo/gshell/trunk/gshell-commands/gshell-repository/src/main/resources/META-INF/spring/components.xml
    geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/resources/META-INF/spring/components.xml
    geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/resources/META-INF/spring/components.xml
    geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/resources/META-INF/spring/components.xml
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandManager.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandSupport.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/spring/components.xml

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=697876&r1=697875&r2=697876&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
Mon Sep 22 09:00:31 2008
@@ -31,13 +31,6 @@
 public interface Command
 {
     /**
-     * Returns the configured identifier of the command.
-     *
-     * @return  The command identifier; never null.
-     */
-    String getId();
-
-    /**
      * Returns the action of the command.
      *
      * @return  The command action; never null.

Modified: geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/META-INF/spring/components.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/META-INF/spring/components.xml?rev=697876&r1=697875&r2=697876&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/META-INF/spring/components.xml
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/resources/META-INF/spring/components.xml
Mon Sep 22 09:00:31 2008
@@ -41,25 +41,21 @@
         </property>
     </bean>
 
+    <bean name="gshell-admin:list-plugins" class="org.apache.geronimo.gshell.commands.admin.ListPluginsAction"
scope="prototype"/>
+
+    <bean name="gshell-admin:install-plugin" class="org.apache.geronimo.gshell.commands.admin.InstallPluginAction"
scope="prototype"/>
+
     <bean class="org.apache.geronimo.gshell.wisdom.plugin.bundle.CommandBundle" lazy-init="true">
         <property name="id" value="default"/>
 
         <property name="commands">
             <list>
-                <bean parent="commandTemplate">
-                    <property name="id" value="gshell-admin:list-plugins"/>
-
-                    <property name="action">
-                        <bean class="org.apache.geronimo.gshell.commands.admin.ListPluginsAction"/>
-                    </property>
+                <bean parent="statefulCommandTemplate">
+                    <property name="actionId" value="gshell-admin:list-plugins"/>
                 </bean>
 
-                <bean parent="commandTemplate">
-                    <property name="id" value="gshell-admin:install-plugin"/>
-
-                    <property name="action">
-                        <bean class="org.apache.geronimo.gshell.commands.admin.InstallPluginAction"/>
-                    </property>
+                <bean parent="statefulCommandTemplate">
+                    <property name="actionId" value="gshell-admin:install-plugin"/>
                 </bean>
             </list>
         </property>

Modified: geronimo/gshell/trunk/gshell-commands/gshell-bsf/src/main/resources/META-INF/spring/components.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-bsf/src/main/resources/META-INF/spring/components.xml?rev=697876&r1=697875&r2=697876&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-bsf/src/main/resources/META-INF/spring/components.xml
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-bsf/src/main/resources/META-INF/spring/components.xml
Mon Sep 22 09:00:31 2008
@@ -41,17 +41,15 @@
         </property>
     </bean>
 
+    <bean name="gshell-bsf:script" class="org.apache.geronimo.gshell.commands.bsf.ScriptAction"
scope="prototype"/>
+
     <bean class="org.apache.geronimo.gshell.wisdom.plugin.bundle.CommandBundle" lazy-init="true">
         <property name="id" value="default"/>
 
         <property name="commands">
             <list>
-                <bean parent="commandTemplate">
-                    <property name="id" value="gshell-bsf:script"/>
-
-                    <property name="action">
-                        <bean class="org.apache.geronimo.gshell.commands.bsf.ScriptAction"/>
-                    </property>
+                <bean parent="statefulCommandTemplate">
+                    <property name="actionId" value="gshell-bsf:script"/>
                 </bean>
             </list>
         </property>

Modified: geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/META-INF/spring/components.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/META-INF/spring/components.xml?rev=697876&r1=697875&r2=697876&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/META-INF/spring/components.xml
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/META-INF/spring/components.xml
Mon Sep 22 09:00:31 2008
@@ -61,37 +61,30 @@
         <property name="commands">
             <list>
                 <bean parent="statelessCommandTemplate">
-                    <property name="id" value="gshell-builtins:clear"/>
                     <property name="action" ref="gshell-builtins:clear"/>
                 </bean>
 
                 <bean parent="statefulCommandTemplate">
-                    <property name="id" value="gshell-builtins:echo"/>
                     <property name="actionId" value="gshell-builtins:echo"/>
                 </bean>
 
                 <bean parent="statefulCommandTemplate">
-                    <property name="id" value="gshell-builtins:exit"/>
                     <property name="actionId" value="gshell-builtins:exit"/>
                 </bean>
 
                 <bean parent="statefulCommandTemplate">
-                    <property name="id" value="gshell-builtins:help"/>
                     <property name="actionId" value="gshell-builtins:help"/>
                 </bean>
 
                 <bean parent="statefulCommandTemplate">
-                    <property name="id" value="gshell-builtins:source"/>
                     <property name="actionId" value="gshell-builtins:source"/>
                 </bean>
                 
                 <bean parent="statefulCommandTemplate">
-                    <property name="id" value="gshell-builtins:set"/>
                     <property name="actionId" value="gshell-builtins:set"/>
                 </bean>
 
                 <bean parent="statefulCommandTemplate">
-                    <property name="id" value="gshell-builtins:unset"/>
                     <property name="actionId" value="gshell-builtins:unset"/>
                 </bean>
             </list>

Modified: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/META-INF/spring/components.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/META-INF/spring/components.xml?rev=697876&r1=697875&r2=697876&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/META-INF/spring/components.xml
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/META-INF/spring/components.xml
Mon Sep 22 09:00:31 2008
@@ -41,49 +41,39 @@
         </property>
     </bean>
 
+    <bean name="gshell-optional:cat" class="org.apache.geronimo.gshell.commands.optional.CatAction"
scope="prototype"/>
+
+    <bean name="gshell-optional:exec" class="org.apache.geronimo.gshell.commands.optional.ExecuteAction"
scope="prototype"/>
+
+    <bean name="gshell-optional:java" class="org.apache.geronimo.gshell.commands.optional.JavaAction"
scope="prototype"/>
+
+    <bean name="gshell-optional:sleep" class="org.apache.geronimo.gshell.commands.optional.SleepAction"
scope="prototype"/>
+
+    <bean name="gshell-optional:wait" class="org.apache.geronimo.gshell.commands.optional.WaitAction"
scope="prototype"/>
+
     <bean class="org.apache.geronimo.gshell.wisdom.plugin.bundle.CommandBundle" lazy-init="true">
         <property name="id" value="default"/>
 
         <property name="commands">
             <list>
-                <bean parent="commandTemplate">
-                    <property name="id" value="gshell-optional:cat"/>
-
-                    <property name="action">
-                        <bean class="org.apache.geronimo.gshell.commands.optional.CatAction"/>
-                    </property>
+                <bean parent="statefulCommandTemplate">
+                    <property name="actionId" value="gshell-optional:cat"/>
                 </bean>
 
-                <bean parent="commandTemplate">
-                    <property name="id" value="gshell-optional:exec"/>
-
-                    <property name="action">
-                        <bean class="org.apache.geronimo.gshell.commands.optional.ExecuteAction"/>
-                    </property>
+                <bean parent="statefulCommandTemplate">
+                    <property name="actionId" value="gshell-optional:exec"/>
                 </bean>
 
-                <bean parent="commandTemplate">
-                    <property name="id" value="gshell-optional:java"/>
-
-                    <property name="action">
-                        <bean class="org.apache.geronimo.gshell.commands.optional.JavaAction"/>
-                    </property>
+                <bean parent="statefulCommandTemplate">
+                    <property name="actionId" value="gshell-optional:java"/>
                 </bean>
 
-                <bean parent="commandTemplate">
-                    <property name="id" value="gshell-optional:sleep"/>
-
-                    <property name="action">
-                        <bean class="org.apache.geronimo.gshell.commands.optional.SleepAction"/>
-                    </property>
+                <bean parent="statefulCommandTemplate">
+                    <property name="actionId" value="gshell-optional:sleep"/>
                 </bean>
 
-                <bean parent="commandTemplate">
-                    <property name="id" value="gshell-optional:wait"/>
-
-                    <property name="action">
-                        <bean class="org.apache.geronimo.gshell.commands.optional.WaitAction"/>
-                    </property>
+                <bean parent="statelessCommandTemplate">
+                    <property name="action" ref="gshell-optional:wait"/>
                 </bean>
             </list>
         </property>

Modified: geronimo/gshell/trunk/gshell-commands/gshell-repository/src/main/resources/META-INF/spring/components.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-repository/src/main/resources/META-INF/spring/components.xml?rev=697876&r1=697875&r2=697876&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-repository/src/main/resources/META-INF/spring/components.xml
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-repository/src/main/resources/META-INF/spring/components.xml
Mon Sep 22 09:00:31 2008
@@ -41,17 +41,15 @@
         </property>
     </bean>
 
+    <bean name="gshell-repository:resolve" class="org.apache.geronimo.gshell.commands.repository.ResolveAction"
scope="prototype"/>
+
     <bean class="org.apache.geronimo.gshell.wisdom.plugin.bundle.CommandBundle" lazy-init="true">
         <property name="id" value="default"/>
 
         <property name="commands">
             <list>
-                <bean parent="commandTemplate">
-                    <property name="id" value="gshell-repository:resolve"/>
-
-                    <property name="action">
-                        <bean class="org.apache.geronimo.gshell.commands.repository.ResolveAction"/>
-                    </property>
+                <bean parent="statefulCommandTemplate">
+                    <property name="actionId" value="gshell-repository:resolve"/>
                 </bean>
             </list>
         </property>

Modified: geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/resources/META-INF/spring/components.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/resources/META-INF/spring/components.xml?rev=697876&r1=697875&r2=697876&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/resources/META-INF/spring/components.xml
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/resources/META-INF/spring/components.xml
Mon Sep 22 09:00:31 2008
@@ -41,17 +41,15 @@
         </property>
     </bean>
 
+    <bean name="gshell-vfs:copy" class="org.apache.geronimo.gshell.commands.vfs.CopyAction"
scope="prototype"/>
+
     <bean class="org.apache.geronimo.gshell.wisdom.plugin.bundle.CommandBundle" lazy-init="true">
         <property name="id" value="default"/>
 
         <property name="commands">
             <list>
-                <bean parent="commandTemplate">
-                    <property name="id" value="gshell-vfs:copy"/>
-
-                    <property name="action">
-                        <bean class="org.apache.geronimo.gshell.commands.vfs.CopyAction"/>
-                    </property>
+                <bean parent="statefulCommandTemplate">
+                    <property name="actionId" value="gshell-vfs:copy"/>
                 </bean>
             </list>
         </property>

Modified: geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/resources/META-INF/spring/components.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/resources/META-INF/spring/components.xml?rev=697876&r1=697875&r2=697876&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/resources/META-INF/spring/components.xml
(original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/resources/META-INF/spring/components.xml
Mon Sep 22 09:00:31 2008
@@ -41,17 +41,15 @@
         </property>
     </bean>
 
+    <bean name="gshell-remote-client:rsh" class="org.apache.geronimo.gshell.remote.client.RshCommand"
scope="prototype"/>
+
     <bean class="org.apache.geronimo.gshell.wisdom.plugin.bundle.CommandBundle" lazy-init="true">
         <property name="id" value="default"/>
 
         <property name="commands">
             <list>
-                <bean parent="commandTemplate">
-                    <property name="id" value="gshell-remote-client:rsh"/>
-
-                    <property name="action">
-                        <bean class="org.apache.geronimo.gshell.remote.client.RshCommand"/>
-                    </property>
+                <bean parent="statefulCommandTemplate">
+                    <property name="actionId" value="gshell-remote-client:rsh"/>
                 </bean>
             </list>
         </property>

Modified: geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/resources/META-INF/spring/components.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/resources/META-INF/spring/components.xml?rev=697876&r1=697875&r2=697876&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/resources/META-INF/spring/components.xml
(original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/resources/META-INF/spring/components.xml
Mon Sep 22 09:00:31 2008
@@ -41,17 +41,15 @@
         </property>
     </bean>
 
+    <bean name="gshell-remote-server:rsh-server" class="org.apache.geronimo.gshell.remote.server.RshServerCommand"
scope="prototype"/>
+
     <bean class="org.apache.geronimo.gshell.wisdom.plugin.bundle.CommandBundle" lazy-init="true">
         <property name="id" value="default"/>
 
         <property name="commands">
             <list>
-                <bean parent="commandTemplate">
-                    <property name="id" value="gshell-remote-server:rsh-server"/>
-
-                    <property name="action">
-                        <bean class="org.apache.geronimo.gshell.remote.server.RshServerCommand"/>
-                    </property>
+                <bean parent="statefulCommandTemplate">
+                    <property name="actionId" value="gshell-remote-server:rsh-server"/>
                 </bean>
             </list>
         </property>

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandManager.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandManager.java?rev=697876&r1=697875&r2=697876&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandManager.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandManager.java
Mon Sep 22 09:00:31 2008
@@ -56,9 +56,7 @@
     public CommandRegistration register(final Command command) {
         assert command != null;
 
-        String id = command.getId();
-
-        log.debug("Registering command: {}", id);
+        log.debug("Registering command: {}", command);
 
         CommandRegistration registration = new CommandRegistration() {
             public Command getCommand() {

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandSupport.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandSupport.java?rev=697876&r1=697875&r2=697876&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandSupport.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandSupport.java
Mon Sep 22 09:00:31 2008
@@ -19,25 +19,24 @@
 
 package org.apache.geronimo.gshell.wisdom.command;
 
+import org.apache.geronimo.gshell.clp.CommandLineProcessor;
+import org.apache.geronimo.gshell.command.Arguments;
 import org.apache.geronimo.gshell.command.Command;
 import org.apache.geronimo.gshell.command.CommandAction;
 import org.apache.geronimo.gshell.command.CommandAware;
 import org.apache.geronimo.gshell.command.CommandCompleter;
+import org.apache.geronimo.gshell.command.CommandContext;
 import org.apache.geronimo.gshell.command.CommandDocumenter;
 import org.apache.geronimo.gshell.command.CommandResult;
-import org.apache.geronimo.gshell.command.CommandContext;
 import org.apache.geronimo.gshell.command.Variables;
-import org.apache.geronimo.gshell.command.Arguments;
 import org.apache.geronimo.gshell.i18n.MessageSource;
-import org.apache.geronimo.gshell.spring.BeanContainerAware;
-import org.apache.geronimo.gshell.spring.BeanContainer;
-import org.apache.geronimo.gshell.shell.ShellContext;
 import org.apache.geronimo.gshell.io.IO;
 import org.apache.geronimo.gshell.notification.Notification;
-import org.apache.geronimo.gshell.clp.CommandLineProcessor;
+import org.apache.geronimo.gshell.shell.ShellContext;
+import org.apache.geronimo.gshell.spring.BeanContainer;
+import org.apache.geronimo.gshell.spring.BeanContainerAware;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.slf4j.MDC;
 
 /**
  * Provides support for {@link Command} implementations.
@@ -49,8 +48,6 @@
 {
     protected final Logger log = LoggerFactory.getLogger(getClass());
 
-    private String id;
-
     private CommandAction action;
 
     private CommandDocumenter documenter;
@@ -59,20 +56,6 @@
 
     private MessageSource messages;
 
-    public String getId() {
-        if (id == null) {
-            throw new IllegalStateException("Missing required property: id");
-        }
-
-        return id;
-    }
-
-    public void setId(final String id) {
-        assert id != null;
-
-        this.id = id;
-    }
-
     public CommandAction getAction() {
         if (action == null) {
             throw new IllegalStateException("Missing required property: action");
@@ -179,9 +162,6 @@
 
         log.trace("Executing");
 
-        // Provide logging context for the command execution
-        MDC.put("command-id", getId());
-
         // Set the TCL to the command bean containers realm
         final ClassLoader prevCL = Thread.currentThread().getContextClassLoader();
         Thread.currentThread().setContextClassLoader(getContainer().getClassRealm());
@@ -250,8 +230,6 @@
         }
         finally {
             Thread.currentThread().setContextClassLoader(prevCL);
-
-            MDC.remove("command-id");
         }
 
         return result;

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/spring/components.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/spring/components.xml?rev=697876&r1=697875&r2=697876&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/spring/components.xml
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/spring/components.xml
Mon Sep 22 09:00:31 2008
@@ -43,20 +43,6 @@
 
     <bean id="shell" class="org.apache.geronimo.gshell.wisdom.shell.ShellImpl"/>
 
-    <bean id="commandTemplate" class="org.apache.geronimo.gshell.wisdom.command.StatelessCommand"
abstract="true">
-        <property name="documenter">
-            <bean class="org.apache.geronimo.gshell.wisdom.command.CommandDocumenterImpl"/>
-        </property>
-
-        <property name="completer">
-            <bean class="org.apache.geronimo.gshell.wisdom.command.CommandCompleterImpl"/>
-        </property>
-
-        <property name="messages">
-            <bean class="org.apache.geronimo.gshell.wisdom.command.CommandMessageSource"/>
-        </property>
-    </bean>
-
     <bean id="statelessCommandTemplate" class="org.apache.geronimo.gshell.wisdom.command.StatelessCommand"
abstract="true">
         <property name="documenter">
             <bean class="org.apache.geronimo.gshell.wisdom.command.CommandDocumenterImpl"/>



Mime
View raw message