You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2008/06/05 14:42:02 UTC

svn commit: r663592 - /geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/DefaultCommandContainer.java

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() {