geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r663592 - /geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/DefaultCommandContainer.java
Date Thu, 05 Jun 2008 12:42:02 GMT
Author: jdillon
Date: Thu Jun  5 05:42:01 2008
New Revision: 663592

URL: http://svn.apache.org/viewvc?rev=663592&view=rev
Log:
Use the model to find the command's description

Modified:
    geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/DefaultCommandContainer.java

Modified: geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/DefaultCommandContainer.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/DefaultCommandContainer.java?rev=663592&r1=663591&r2=663592&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/DefaultCommandContainer.java
(original)
+++ geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/DefaultCommandContainer.java
Thu Jun  5 05:42:01 2008
@@ -22,7 +22,6 @@
 import org.apache.geronimo.gshell.command.CommandContainer;
 import org.apache.geronimo.gshell.command.CommandContext;
 import org.apache.geronimo.gshell.command.Executable;
-import org.apache.geronimo.gshell.command.annotation.CommandComponent;
 import org.apache.geronimo.gshell.plexus.GShellPlexusContainer;
 import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.component.annotations.Component;
@@ -68,15 +67,9 @@
     }
 
     public String getDescription() {
-        //
-        // FIXME: Can fetch this from the model... ?
-        //
-
-        CommandComponent cmd = getExecutable().getClass().getAnnotation(CommandComponent.class);
-        if (cmd == null) {
-            throw new IllegalStateException("Command description not found");
-        }
-        return cmd.description();
+        assert container != null;
+        
+        return container.getComponentDescriptor(CommandContainer.class.getName(), commandId).getDescription();
     }
 
     public Executable getExecutable() {



Mime
View raw message