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:33:36 UTC
svn commit: r663586 - in /geronimo/gshell/trunk:
gshell-api/src/main/java/org/apache/geronimo/gshell/command/
gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/
gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/descriptor/
Author: jdillon
Date: Thu Jun 5 05:33:36 2008
New Revision: 663586
URL: http://svn.apache.org/viewvc?rev=663586&view=rev
Log:
More work to ween the platform off of the Command interface and use Executable instead
Modified:
geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Executable.java
geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/DefaultCommandContainer.java
geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/descriptor/CommandDescriptor.java
Modified: geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Executable.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Executable.java?rev=663586&r1=663585&r2=663586&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Executable.java (original)
+++ geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Executable.java Thu Jun 5 05:33:36 2008
@@ -30,6 +30,8 @@
Result FAILURE = Result.FAILURE;
+ // TODO: Change this to ExecutionContext
+
Object execute(CommandContext context, Object... args) throws Exception;
//
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=663586&r1=663585&r2=663586&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:33:36 2008
@@ -20,20 +20,19 @@
package org.apache.geronimo.gshell.plugin;
import org.apache.geronimo.gshell.command.CommandContainer;
-import org.apache.geronimo.gshell.command.Command;
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.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.codehaus.plexus.component.annotations.Configuration;
+import org.codehaus.plexus.PlexusConstants;
import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Configuration;
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
-import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
import org.codehaus.plexus.context.Context;
import org.codehaus.plexus.context.ContextException;
-import org.codehaus.plexus.PlexusConstants;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* ???
@@ -70,7 +69,7 @@
public String getDescription() {
//
- // FIXME:
+ // FIXME: Can fetch this from the model... ?
//
CommandComponent cmd = getExecutable().getClass().getAnnotation(CommandComponent.class);
@@ -84,7 +83,7 @@
assert container != null;
try {
- return container.lookupComponent(Command.class, commandId);
+ return container.lookupComponent(Executable.class, commandId);
}
catch (ComponentLookupException e) {
throw new RuntimeException(e);
Modified: geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/descriptor/CommandDescriptor.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/descriptor/CommandDescriptor.java?rev=663586&r1=663585&r2=663586&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/descriptor/CommandDescriptor.java (original)
+++ geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/descriptor/CommandDescriptor.java Thu Jun 5 05:33:36 2008
@@ -24,6 +24,7 @@
import org.apache.geronimo.gshell.model.command.Command;
import org.apache.geronimo.gshell.model.command.Parameter;
import org.apache.geronimo.gshell.model.command.Requirement;
+import org.apache.geronimo.gshell.command.Executable;
import org.codehaus.plexus.component.repository.ComponentRequirement;
import org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration;
@@ -43,7 +44,7 @@
this.command = command;
setDescription(command.getDescription());
- setRole(org.apache.geronimo.gshell.command.Command.class);
+ setRole(Executable.class);
setRoleHint(command.getId());
setImplementation(command.getImplementation());
setVersion(command.getVersion());