Author: jdillon
Date: Thu Sep 6 12:44:54 2007
New Revision: 573345
URL: http://svn.apache.org/viewvc?rev=573345&view=rev
Log:
Moved the descriptor bits to the api module, drop usage of the gshell plugin for the moment and only build builtins for now
Added:
geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/annotation/CommandComponent.java (contents, props changed)
- copied, changed from r573330, geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/annotation/Command.java
geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/descriptor/
geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/descriptor/CommandDescriptor.java
- copied, changed from r573330, geronimo/sandbox/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/CommandDescriptor.java
geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/descriptor/CommandSetDescriptor.java (contents, props changed)
- copied, changed from r573330, geronimo/sandbox/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/PluginDescriptor.java
geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/descriptor/package-info.java (with props)
geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/META-INF/
geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/META-INF/gshell/
geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/META-INF/gshell/commands.xml (with props)
geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/
geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/CommandSetDescriptorBuilder.java (contents, props changed)
- copied, changed from r573330, geronimo/sandbox/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/PluginDescriptorBuilder.java
geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/PluginCollector.java (contents, props changed)
- copied, changed from r573330, geronimo/sandbox/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/PluginCollector.java
geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/PluginDiscoverer.java (contents, props changed)
- copied, changed from r573330, geronimo/sandbox/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/PluginDiscoverer.java
Removed:
geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/annotation/Command.java
geronimo/sandbox/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/PluginCollector.java
geronimo/sandbox/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/PluginDescriptor.java
geronimo/sandbox/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/PluginDescriptorBuilder.java
geronimo/sandbox/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/PluginDiscoverer.java
Modified:
geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandContext.java
geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandSupport.java
geronimo/sandbox/gshell/trunk/gshell-commands/gshell-bsf/src/main/java/org/apache/geronimo/gshell/commands/bsf/ScriptCommand.java
geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/pom.xml
geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/ExitCommand.java
geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpCommand.java
geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/SetCommand.java
geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/SourceCommand.java
geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/UnsetCommand.java
geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/CatCommand.java
geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/EchoCommand.java
geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/ExecuteCommand.java
geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/JavaCommand.java
geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/SleepCommand.java
geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/WaitCommand.java
geronimo/sandbox/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/CopyCommand.java
geronimo/sandbox/gshell/trunk/gshell-commands/pom.xml
geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/ShellImpl.java
geronimo/sandbox/gshell/trunk/gshell-maven-plugin/src/main/java/org/apache/geronimo/gshell/maven/gshell/PluginDescriptorMojo.java
geronimo/sandbox/gshell/trunk/pom.xml
Modified: geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandContext.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandContext.java?rev=573345&r1=573344&r2=573345&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandContext.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandContext.java Thu Sep 6 12:44:54 2007
@@ -21,16 +21,20 @@
import java.io.File;
+import org.apache.geronimo.gshell.command.descriptor.CommandDescriptor;
+
/**
* Provides commands with the context of its execution.
*
- * @version $Rev$ $Date$
+ * @version $Rev: 572562 $ $Date: 2007-09-04 00:43:23 -0700 (Tue, 04 Sep 2007) $
*/
public interface CommandContext
{
IO getIO();
Variables getVariables();
+
+ CommandDescriptor getCommandDescriptor();
//
Modified: geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandSupport.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandSupport.java?rev=573345&r1=573344&r2=573345&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandSupport.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandSupport.java Thu Sep 6 12:44:54 2007
@@ -110,23 +110,12 @@
*/
protected abstract Object doExecute() throws Exception;
- //
- // CLI Fluff
- //
-
- //
- // NOTE: I think this should probably just go the f away... The usage mucko oh top too... gotta either be able
- // to generate that, or configure it via an annotation. For the help, well we can add some header/footer muck
- // but for 95%, maybe even 99% of the folks they don't really need to override this... blah. And really they
- // shouldn't cause that introduces incosistencies, which is one of the benefits of GShell... :-P
- //
-
protected void displayHelp(final CommandLineProcessor clp) {
assert clp != null;
- // io.out.print(getName());
- // io.out.print(" -- ");
- // io.out.println();
+ io.out.println(context.getCommandDescriptor().getName());
+ io.out.println(" -- ");
+ io.out.println();
Printer printer = new Printer(clp);
printer.printUsage(io.out);
Copied: geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/annotation/CommandComponent.java (from r573330, geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/annotation/Command.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/annotation/CommandComponent.java?p2=geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/annotation/CommandComponent.java&p1=geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/annotation/Command.java&r1=573330&r2=573345&rev=573345&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/annotation/Command.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/annotation/CommandComponent.java Thu Sep 6 12:44:54 2007
@@ -24,10 +24,6 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
-//
-// FIXME: Rename to CommandComponent... so this doesn't class with the Command interface
-//
-
/**
* Annotation to mark classes as GShell commands implementations.
*
@@ -35,11 +31,9 @@
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
-public @interface Command
+public @interface CommandComponent
{
String name();
String description() default "";
-
- String comment() default "";
}
Propchange: geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/annotation/CommandComponent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/annotation/CommandComponent.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/annotation/CommandComponent.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Copied: geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/descriptor/CommandDescriptor.java (from r573330, geronimo/sandbox/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/CommandDescriptor.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/descriptor/CommandDescriptor.java?p2=geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/descriptor/CommandDescriptor.java&p1=geronimo/sandbox/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/CommandDescriptor.java&r1=573330&r2=573345&rev=573345&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/CommandDescriptor.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/descriptor/CommandDescriptor.java Thu Sep 6 12:44:54 2007
@@ -17,13 +17,12 @@
* under the License.
*/
-package org.apache.geronimo.gshell.plugin;
+package org.apache.geronimo.gshell.command.descriptor;
import org.codehaus.plexus.component.repository.ComponentDescriptor;
-import org.codehaus.plexus.configuration.PlexusConfiguration;
/**
- * Container for plugin descriptions.
+ * Descriptor for a command.
*
* @version $Rev$ $Date$
*/
@@ -32,12 +31,6 @@
{
private String name;
- private String description;
-
- private String comment;
-
- private Object configuration;
-
public String getName() {
return name;
}
@@ -47,28 +40,4 @@
this.name = name;
}
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(final String description) {
- this.description = description;
- }
-
- public String getComment() {
- return comment;
- }
-
- public void setComment(final String comment) {
- this.comment = comment;
- }
-
- public void setCommandConfiguration(final PlexusConfiguration configuration) {
- this.configuration = configuration;
- }
-
- public Object getCommandConfiguration() {
- return configuration;
- }
-}
+}
\ No newline at end of file
Copied: geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/descriptor/CommandSetDescriptor.java (from r573330, geronimo/sandbox/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/PluginDescriptor.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/descriptor/CommandSetDescriptor.java?p2=geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/descriptor/CommandSetDescriptor.java&p1=geronimo/sandbox/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/PluginDescriptor.java&r1=573330&r2=573345&rev=573345&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/PluginDescriptor.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/descriptor/CommandSetDescriptor.java Thu Sep 6 12:44:54 2007
@@ -17,41 +17,29 @@
* under the License.
*/
-package org.apache.geronimo.gshell.plugin;
+package org.apache.geronimo.gshell.command.descriptor;
-import java.util.List;
-
-import org.apache.geronimo.gshell.plugin.model.Command;
-import org.codehaus.plexus.component.composition.Requirement;
import org.codehaus.plexus.component.repository.ComponentSetDescriptor;
/**
- * Container for additional component information for GShell plugins.
+ * Descriptor for a set of commands.
*
* @version $Rev$ $Date$
*/
-public class PluginDescriptor
+public class CommandSetDescriptor
extends ComponentSetDescriptor
{
private String name;
private String description;
- private String comment;
-
- private List<Command> commands;
-
- private Object configuration;
-
- private List<Requirement> requirements;
-
public String getName() {
return name;
}
public void setName(final String name) {
assert name != null;
-
+
this.name = name;
}
@@ -62,43 +50,7 @@
public void setDescription(final String description) {
this.description = description;
}
-
- public String getComment() {
- return comment;
- }
-
- public void setComment(final String comment) {
- this.comment = comment;
- }
-
- public List<Command> getCommands() {
- return commands;
- }
-
- public void setCommands(final List<Command> commands) {
- assert name != null;
-
- this.commands = commands;
- }
-
- public Object getConfiguration() {
- return configuration;
- }
-
- public void setConfiguration(final Object configuration) {
- this.configuration = configuration;
- }
-
- public List<Requirement> getRequirements() {
- return requirements;
- }
-
- public void setRequirements(final List<Requirement> requirements) {
- assert name != null;
-
- this.requirements = requirements;
- }
-
+
public void addCommandDescriptor(final CommandDescriptor desc) {
assert desc != null;
Propchange: geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/descriptor/CommandSetDescriptor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/descriptor/CommandSetDescriptor.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/descriptor/CommandSetDescriptor.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/descriptor/package-info.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/descriptor/package-info.java?rev=573345&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/descriptor/package-info.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/descriptor/package-info.java Thu Sep 6 12:44:54 2007
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Command component descriptors.
+ *
+ * @version $Rev$ $Date$
+ */
+package org.apache.geronimo.gshell.command.descriptor;
Propchange: geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/descriptor/package-info.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/descriptor/package-info.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/descriptor/package-info.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-bsf/src/main/java/org/apache/geronimo/gshell/commands/bsf/ScriptCommand.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-bsf/src/main/java/org/apache/geronimo/gshell/commands/bsf/ScriptCommand.java?rev=573345&r1=573344&r2=573345&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-bsf/src/main/java/org/apache/geronimo/gshell/commands/bsf/ScriptCommand.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-bsf/src/main/java/org/apache/geronimo/gshell/commands/bsf/ScriptCommand.java Thu Sep 6 12:44:54 2007
@@ -24,8 +24,7 @@
import org.apache.geronimo.gshell.JLineConsole;
import org.apache.geronimo.gshell.clp.Option;
import org.apache.geronimo.gshell.command.CommandSupport;
-import org.apache.geronimo.gshell.command.IO;
-import org.apache.geronimo.gshell.command.annotation.Command;
+import org.apache.geronimo.gshell.command.annotation.CommandComponent;
import org.apache.geronimo.gshell.console.Console;
/**
@@ -33,7 +32,7 @@
*
* @version $Rev$ $Date$
*/
-@Command(name="script")
+@CommandComponent(name="script")
public class ScriptCommand
extends CommandSupport
{
Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/pom.xml?rev=573345&r1=573344&r2=573345&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/pom.xml Thu Sep 6 12:44:54 2007
@@ -45,6 +45,7 @@
</dependency>
</dependencies>
+ <!--
<build>
<plugins>
<plugin>
@@ -61,5 +62,6 @@
</plugin>
</plugins>
</build>
-
+ -->
+
</project>
Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/ExitCommand.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/ExitCommand.java?rev=573345&r1=573344&r2=573345&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/ExitCommand.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/ExitCommand.java Thu Sep 6 12:44:54 2007
@@ -22,14 +22,14 @@
import org.apache.geronimo.gshell.ExitNotification;
import org.apache.geronimo.gshell.clp.Argument;
import org.apache.geronimo.gshell.command.CommandSupport;
-import org.apache.geronimo.gshell.command.annotation.Command;
+import org.apache.geronimo.gshell.command.annotation.CommandComponent;
/**
* Exit the current shell.
*
* @version $Rev$ $Date$
*/
-@Command(name="exit")
+@CommandComponent(name="exit")
public class ExitCommand
extends CommandSupport
{
Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpCommand.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpCommand.java?rev=573345&r1=573344&r2=573345&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpCommand.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpCommand.java Thu Sep 6 12:44:54 2007
@@ -21,9 +21,10 @@
import java.util.List;
+import org.apache.geronimo.gshell.command.Command;
import org.apache.geronimo.gshell.command.CommandSupport;
-import org.apache.geronimo.gshell.command.IO;
-import org.apache.geronimo.gshell.command.annotation.Command;
+import org.apache.geronimo.gshell.command.descriptor.CommandDescriptor;
+import org.apache.geronimo.gshell.command.annotation.CommandComponent;
import org.codehaus.plexus.PlexusContainer;
import org.codehaus.plexus.component.annotations.Requirement;
import org.codehaus.plexus.component.repository.ComponentDescriptor;
@@ -33,7 +34,7 @@
*
* @version $Rev$ $Date$
*/
-@Command(name="help")
+@CommandComponent(name="help")
public class HelpCommand
extends CommandSupport
{
@@ -45,11 +46,12 @@
io.out.println("Available commands:");
- List<ComponentDescriptor> list = container.getComponentDescriptorList(org.apache.geronimo.gshell.command.Command.class.getName());
+ //noinspection unchecked
+ List<CommandDescriptor> list = container.getComponentDescriptorList(Command.class.getName());
- for (ComponentDescriptor desc : list) {
+ for (CommandDescriptor desc : list) {
io.out.print(" ");
- io.out.print(desc.getRoleHint());
+ io.out.print(desc.getName());
io.out.println();
}
Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/SetCommand.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/SetCommand.java?rev=573345&r1=573344&r2=573345&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/SetCommand.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/SetCommand.java Thu Sep 6 12:44:54 2007
@@ -27,16 +27,15 @@
import org.apache.geronimo.gshell.clp.Argument;
import org.apache.geronimo.gshell.clp.Option;
import org.apache.geronimo.gshell.command.CommandSupport;
-import org.apache.geronimo.gshell.command.IO;
import org.apache.geronimo.gshell.command.Variables;
-import org.apache.geronimo.gshell.command.annotation.Command;
+import org.apache.geronimo.gshell.command.annotation.CommandComponent;
/**
* Set a variable or property.
*
* @version $Rev$ $Date$
*/
-@Command(name="set")
+@CommandComponent(name="set")
public class SetCommand
extends CommandSupport
{
Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/SourceCommand.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/SourceCommand.java?rev=573345&r1=573344&r2=573345&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/SourceCommand.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/SourceCommand.java Thu Sep 6 12:44:54 2007
@@ -30,7 +30,7 @@
import org.apache.geronimo.gshell.Shell;
import org.apache.geronimo.gshell.clp.Argument;
import org.apache.geronimo.gshell.command.CommandSupport;
-import org.apache.geronimo.gshell.command.annotation.Command;
+import org.apache.geronimo.gshell.command.annotation.CommandComponent;
import org.codehaus.plexus.component.annotations.Requirement;
/**
@@ -38,7 +38,7 @@
*
* @version $Rev$ $Date$
*/
-@Command(name="source")
+@CommandComponent(name="source")
public class SourceCommand
extends CommandSupport
{
Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/UnsetCommand.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/UnsetCommand.java?rev=573345&r1=573344&r2=573345&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/UnsetCommand.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/UnsetCommand.java Thu Sep 6 12:44:54 2007
@@ -26,14 +26,14 @@
import org.apache.geronimo.gshell.clp.Option;
import org.apache.geronimo.gshell.command.CommandSupport;
import org.apache.geronimo.gshell.command.Variables;
-import org.apache.geronimo.gshell.command.annotation.Command;
+import org.apache.geronimo.gshell.command.annotation.CommandComponent;
/**
* Unset a variable or property.
*
* @version $Rev$ $Date$
*/
-@Command(name="unset")
+@CommandComponent(name="unset")
public class UnsetCommand
extends CommandSupport
{
Added: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/META-INF/gshell/commands.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/META-INF/gshell/commands.xml?rev=573345&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/META-INF/gshell/commands.xml (added)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/META-INF/gshell/commands.xml Thu Sep 6 12:44:54 2007
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<command-set>
+ <name>gshell-builtins</name>
+
+ <commands>
+ <command>
+ <name>exit</name>
+ <implementation>org.apache.geronimo.gshell.commands.builtins.ExitCommand</implementation>
+ </command>
+
+ <command>
+ <name>help</name>
+ <implementation>org.apache.geronimo.gshell.commands.builtins.HelpCommand</implementation>
+ <requirements>
+ <requirement>
+ <role>org.codehaus.plexus.PlexusContainer</role>
+ <field-name>container</field-name>
+ </requirement>
+ </requirements>
+ </command>
+
+ <command>
+ <name>set</name>
+ <implementation>org.apache.geronimo.gshell.commands.builtins.SetCommand</implementation>
+ </command>
+
+ <command>
+ <name>source</name>
+ <implementation>org.apache.geronimo.gshell.commands.builtins.SourceCommand</implementation>
+ <requirements>
+ <requirement>
+ <role>org.apache.geronimo.gshell.Shell</role>
+ <field-name>shell</field-name>
+ </requirement>
+ </requirements>
+ </command>
+
+ <command>
+ <name>unset</name>
+ <implementation>org.apache.geronimo.gshell.commands.builtins.UnsetCommand</implementation>
+ </command>
+ </commands>
+</command-set>
\ No newline at end of file
Propchange: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/META-INF/gshell/commands.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/META-INF/gshell/commands.xml
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/META-INF/gshell/commands.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/CatCommand.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/CatCommand.java?rev=573345&r1=573344&r2=573345&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/CatCommand.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/CatCommand.java Thu Sep 6 12:44:54 2007
@@ -32,7 +32,7 @@
import org.apache.geronimo.gshell.clp.Option;
import org.apache.geronimo.gshell.command.CommandSupport;
import org.apache.geronimo.gshell.command.IO;
-import org.apache.geronimo.gshell.command.annotation.Command;
+import org.apache.geronimo.gshell.command.annotation.CommandComponent;
import org.codehaus.plexus.util.StringUtils;
/**
@@ -40,7 +40,7 @@
*
* @version $Rev$ $Date$
*/
-@Command(name="cat")
+@CommandComponent(name="cat")
public class CatCommand
extends CommandSupport
{
Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/EchoCommand.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/EchoCommand.java?rev=573345&r1=573344&r2=573345&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/EchoCommand.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/EchoCommand.java Thu Sep 6 12:44:54 2007
@@ -24,15 +24,14 @@
import org.apache.geronimo.gshell.clp.Argument;
import org.apache.geronimo.gshell.clp.Option;
import org.apache.geronimo.gshell.command.CommandSupport;
-import org.apache.geronimo.gshell.command.IO;
-import org.apache.geronimo.gshell.command.annotation.Command;
+import org.apache.geronimo.gshell.command.annotation.CommandComponent;
/**
* A simple command to <em>echo</em> all given arguments to the commands standard output.
*
* @version $Rev$ $Date$
*/
-@Command(name="echo")
+@CommandComponent(name="echo")
public class EchoCommand
extends CommandSupport
{
Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/ExecuteCommand.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/ExecuteCommand.java?rev=573345&r1=573344&r2=573345&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/ExecuteCommand.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/ExecuteCommand.java Thu Sep 6 12:44:54 2007
@@ -23,8 +23,7 @@
import org.apache.geronimo.gshell.clp.Argument;
import org.apache.geronimo.gshell.command.CommandSupport;
-import org.apache.geronimo.gshell.command.IO;
-import org.apache.geronimo.gshell.command.annotation.Command;
+import org.apache.geronimo.gshell.command.annotation.CommandComponent;
import org.apache.geronimo.gshell.common.io.PumpStreamHandler;
/**
@@ -32,7 +31,7 @@
*
* @version $Rev$ $Date$
*/
-@Command(name="exec")public class ExecuteCommand
+@CommandComponent(name="exec")public class ExecuteCommand
extends CommandSupport
{
private ProcessBuilder builder;
Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/JavaCommand.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/JavaCommand.java?rev=573345&r1=573344&r2=573345&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/JavaCommand.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/JavaCommand.java Thu Sep 6 12:44:54 2007
@@ -25,7 +25,7 @@
import org.apache.geronimo.gshell.clp.Argument;
import org.apache.geronimo.gshell.clp.Option;
import org.apache.geronimo.gshell.command.CommandSupport;
-import org.apache.geronimo.gshell.command.annotation.Command;
+import org.apache.geronimo.gshell.command.annotation.CommandComponent;
import org.apache.geronimo.gshell.common.Arguments;
/**
@@ -37,7 +37,7 @@
*
* @version $Rev$ $Date$
*/
-@Command(name="java")
+@CommandComponent(name="java")
public class JavaCommand
extends CommandSupport
{
Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/SleepCommand.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/SleepCommand.java?rev=573345&r1=573344&r2=573345&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/SleepCommand.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/SleepCommand.java Thu Sep 6 12:44:54 2007
@@ -21,14 +21,14 @@
import org.apache.geronimo.gshell.clp.Argument;
import org.apache.geronimo.gshell.command.CommandSupport;
-import org.apache.geronimo.gshell.command.annotation.Command;
+import org.apache.geronimo.gshell.command.annotation.CommandComponent;
/**
* Sleep... zzzZ
*
* @version $Rev$ $Date$
*/
-@Command(name="sleep")
+@CommandComponent(name="sleep")
public class SleepCommand
extends CommandSupport
{
Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/WaitCommand.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/WaitCommand.java?rev=573345&r1=573344&r2=573345&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/WaitCommand.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/WaitCommand.java Thu Sep 6 12:44:54 2007
@@ -20,7 +20,7 @@
package org.apache.geronimo.gshell.commands.optional;
import org.apache.geronimo.gshell.command.CommandSupport;
-import org.apache.geronimo.gshell.command.annotation.Command;
+import org.apache.geronimo.gshell.command.annotation.CommandComponent;
//
// HACK: This is a temporary to handle shells which need to keep around after running
@@ -32,7 +32,7 @@
*
* @version $Rev$ $Date$
*/
-@Command(name="wait")
+@CommandComponent(name="wait")
public class WaitCommand
extends CommandSupport
{
Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/CopyCommand.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/CopyCommand.java?rev=573345&r1=573344&r2=573345&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/CopyCommand.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/CopyCommand.java Thu Sep 6 12:44:54 2007
@@ -23,14 +23,14 @@
import org.apache.commons.vfs.FileSystemManager;
import org.apache.commons.vfs.FileUtil;
import org.apache.geronimo.gshell.clp.Argument;
-import org.apache.geronimo.gshell.command.annotation.Command;
+import org.apache.geronimo.gshell.command.annotation.CommandComponent;
/**
* Copy files.
*
* @version $Rev$ $Date$
*/
-@Command(name="copy")
+@CommandComponent(name="copy")
public class CopyCommand
extends VFSCommandSupport
{
Modified: geronimo/sandbox/gshell/trunk/gshell-commands/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/pom.xml?rev=573345&r1=573344&r2=573345&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/pom.xml Thu Sep 6 12:44:54 2007
@@ -49,9 +49,11 @@
<modules>
<module>gshell-builtins</module>
+ <!--
<module>gshell-optional</module>
<module>gshell-bsf</module>
<module>gshell-vfs</module>
+ -->
</modules>
</project>
Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/ShellImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/ShellImpl.java?rev=573345&r1=573344&r2=573345&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/ShellImpl.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/ShellImpl.java Thu Sep 6 12:44:54 2007
@@ -23,6 +23,7 @@
import org.apache.geronimo.gshell.command.CommandContext;
import org.apache.geronimo.gshell.command.IO;
import org.apache.geronimo.gshell.command.Variables;
+import org.apache.geronimo.gshell.command.descriptor.CommandDescriptor;
import org.apache.geronimo.gshell.common.Arguments;
import org.apache.geronimo.gshell.common.StopWatch;
import org.apache.geronimo.gshell.layout.LayoutManager;
@@ -112,9 +113,9 @@
String realmId = "command-invocation";
final PlexusContainer childContainer = container.createChildContainer(realmId, container.getContainerRealm());
+ final CommandDescriptor commandDescriptor = (CommandDescriptor) childContainer.getComponentDescriptor(Command.class.getName(), commandName);
final Command command = (Command)childContainer.lookup(Command.class, commandName);
-
//
// NOTE: For now, until we can figure out a better way to have the container deal with this stuff, pass in
// the execution context manually
@@ -129,6 +130,10 @@
public Variables getVariables() {
return vars;
+ }
+
+ public CommandDescriptor getCommandDescriptor() {
+ return commandDescriptor;
}
};
Copied: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/CommandSetDescriptorBuilder.java (from r573330, geronimo/sandbox/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/PluginDescriptorBuilder.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/CommandSetDescriptorBuilder.java?p2=geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/CommandSetDescriptorBuilder.java&p1=geronimo/sandbox/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/PluginDescriptorBuilder.java&r1=573330&r2=573345&rev=573345&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/PluginDescriptorBuilder.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/CommandSetDescriptorBuilder.java Thu Sep 6 12:44:54 2007
@@ -22,6 +22,8 @@
import java.io.Reader;
import org.apache.geronimo.gshell.command.Command;
+import org.apache.geronimo.gshell.command.descriptor.CommandDescriptor;
+import org.apache.geronimo.gshell.command.descriptor.CommandSetDescriptor;
import org.codehaus.plexus.component.repository.ComponentRequirement;
import org.codehaus.plexus.component.repository.io.PlexusTools;
import org.codehaus.plexus.configuration.PlexusConfiguration;
@@ -30,37 +32,36 @@
import org.slf4j.LoggerFactory;
/**
- * Helper to build {@link PluginDescriptor} instances from configuration stream.
+ * Helper to build {@link CommandSetDescriptor} instances from configuration stream.
*
* @version $Rev$ $Date$
*/
-public class PluginDescriptorBuilder
+public class CommandSetDescriptorBuilder
{
private Logger log = LoggerFactory.getLogger(getClass());
- public PluginDescriptor build(final Reader reader, final String source) throws PlexusConfigurationException {
+ public CommandSetDescriptor build(final Reader reader, final String source) throws PlexusConfigurationException {
assert reader != null;
assert source != null;
PlexusConfiguration c = PlexusTools.buildConfiguration(source, reader);
- PluginDescriptor pd = new PluginDescriptor();
+ CommandSetDescriptor setDescriptor = new CommandSetDescriptor();
- pd.setName(c.getChild("name").getValue());
- pd.setDescription(c.getChild("description").getValue());
- pd.setComment(c.getChild("comment").getValue());
+ setDescriptor.setName(c.getChild("name").getValue());
+ setDescriptor.setDescription(c.getChild("description").getValue());
- log.debug("Loading plugin: {}", pd.getName());
+ log.debug("Loading command set: {}", setDescriptor.getName());
// Commands
PlexusConfiguration[] commands = c.getChild("commands").getChildren("command");
for (PlexusConfiguration command : commands) {
CommandDescriptor d = createCommandDescriptor(command);
- pd.addCommandDescriptor(d);
+ setDescriptor.addCommandDescriptor(d);
}
- return pd;
+ return setDescriptor;
}
private CommandDescriptor createCommandDescriptor(final PlexusConfiguration c) throws PlexusConfigurationException {
@@ -70,18 +71,12 @@
d.setName(c.getChild("name").getValue());
d.setDescription(c.getChild("description").getValue());
- d.setComment(c.getChild("comment").getValue());
d.setImplementation(c.getChild("implementation").getValue());
- d.setCommandConfiguration(c.getChild("configuration"));
log.debug("Loading command: {}", d.getName());
d.setRole(Command.class.getName());
d.setRoleHint(d.getName());
-
- //
- // HACK: For now just use this, make it configurable later, look at ComponentDescriptor and see what else we want to expose
- //
d.setInstantiationStrategy("per-lookup");
// Requirements
Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/CommandSetDescriptorBuilder.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/CommandSetDescriptorBuilder.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/CommandSetDescriptorBuilder.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Copied: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/PluginCollector.java (from r573330, geronimo/sandbox/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/PluginCollector.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/PluginCollector.java?p2=geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/PluginCollector.java&p1=geronimo/sandbox/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/PluginCollector.java&r1=573330&r2=573345&rev=573345&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/PluginCollector.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/PluginCollector.java Thu Sep 6 12:44:54 2007
@@ -47,16 +47,16 @@
public void componentDiscovered(final ComponentDiscoveryEvent event) {
assert event != null;
- ComponentSetDescriptor desc = event.getComponentSetDescriptor();
+ ComponentSetDescriptor setDescriptor = event.getComponentSetDescriptor();
- for (Object obj : desc.getComponents()) {
- ComponentDescriptor c = (ComponentDescriptor)obj;
+ for (Object obj : setDescriptor.getComponents()) {
+ ComponentDescriptor componentDescriptor = (ComponentDescriptor)obj;
+
+ //
+ // TODO: Do something useful here... for now just log what we have found
+ //
- log.debug("Component discovered: {}", c.getHumanReadableKey());
+ log.debug("Component discovered: {}", componentDescriptor.getHumanReadableKey());
}
-
- //
- // TODO: Figure out wtf we want to do here...
- //
}
}
Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/PluginCollector.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/PluginCollector.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/PluginCollector.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Copied: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/PluginDiscoverer.java (from r573330, geronimo/sandbox/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/PluginDiscoverer.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/PluginDiscoverer.java?p2=geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/PluginDiscoverer.java&p1=geronimo/sandbox/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/PluginDiscoverer.java&r1=573330&r2=573345&rev=573345&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/plugin/PluginDiscoverer.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/PluginDiscoverer.java Thu Sep 6 12:44:54 2007
@@ -30,22 +30,20 @@
import org.slf4j.LoggerFactory;
/**
- * Custom Plexus component discovery component to handle the GShell plugin.xml muck.
+ * Plexus component discovery for GShell commands.
*
* @version $Rev$ $Date$
*/
-@Component(role= ComponentDiscoverer.class, hint="gshell")
+@Component(role=ComponentDiscoverer.class, hint="gshell")
public class PluginDiscoverer
extends AbstractComponentDiscoverer
{
- public static final String PLUGIN_XML_LOCATION = "META-INF/gshell/plugin.xml";
-
private final Logger log = LoggerFactory.getLogger(getClass());
- private final PluginDescriptorBuilder builder = new PluginDescriptorBuilder();
+ private final CommandSetDescriptorBuilder builder = new CommandSetDescriptorBuilder();
public String getComponentDescriptorLocation() {
- return PLUGIN_XML_LOCATION;
+ return "META-INF/gshell/commands.xml";
}
public ComponentSetDescriptor createComponentDescriptors(final Reader reader, final String source)
Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/PluginDiscoverer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/PluginDiscoverer.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/plugin/PluginDiscoverer.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: geronimo/sandbox/gshell/trunk/gshell-maven-plugin/src/main/java/org/apache/geronimo/gshell/maven/gshell/PluginDescriptorMojo.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-maven-plugin/src/main/java/org/apache/geronimo/gshell/maven/gshell/PluginDescriptorMojo.java?rev=573345&r1=573344&r2=573345&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-maven-plugin/src/main/java/org/apache/geronimo/gshell/maven/gshell/PluginDescriptorMojo.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-maven-plugin/src/main/java/org/apache/geronimo/gshell/maven/gshell/PluginDescriptorMojo.java Thu Sep 6 12:44:54 2007
@@ -20,7 +20,6 @@
package org.apache.geronimo.gshell.maven.gshell;
import java.io.File;
-import java.io.StringWriter;
import java.io.IOException;
import java.io.FileWriter;
import java.io.BufferedWriter;
@@ -30,11 +29,11 @@
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.List;
-import java.util.Collections;
import org.apache.geronimo.gshell.plugin.model.Command;
import org.apache.geronimo.gshell.plugin.model.Plugin;
import org.apache.geronimo.gshell.plugin.model.io.xpp3.PluginXpp3Writer;
+import org.apache.geronimo.gshell.command.annotation.CommandComponent;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
@@ -42,13 +41,7 @@
import org.apache.xbean.finder.ClassFinder;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Configuration;
-import org.codehaus.plexus.component.annotations.Parameter;
import org.codehaus.plexus.component.annotations.Requirement;
-import org.codehaus.plexus.component.repository.cdc.ComponentDescriptor;
-import org.codehaus.plexus.component.repository.cdc.ComponentRequirement;
-import org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration;
import org.codehaus.plexus.util.DirectoryScanner;
/**
@@ -160,20 +153,18 @@
localClasses.add(c);
}
- List<Class> commands = new ClassFinder(localClasses).findAnnotatedClasses(org.apache.geronimo.gshell.command.annotation.Command.class);
+ List<Class> commands = new ClassFinder(localClasses).findAnnotatedClasses(CommandComponent.class);
Plugin plugin = new Plugin();
plugin.setName(project.getArtifactId());
for (Class type : commands) {
- org.apache.geronimo.gshell.command.annotation.Command meta = (org.apache.geronimo.gshell.command.annotation.Command)
- type.getAnnotation(org.apache.geronimo.gshell.command.annotation.Command.class);
+ CommandComponent meta = (CommandComponent)type.getAnnotation(CommandComponent.class);
Command c = new Command();
c.setName(meta.name());
c.setDescription(meta.description());
- c.setComment(meta.comment());
c.setImplementation(type.getName());
// Have to look at each class in the tree to look at its declared fields
Modified: geronimo/sandbox/gshell/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/pom.xml?rev=573345&r1=573344&r2=573345&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/pom.xml Thu Sep 6 12:44:54 2007
@@ -343,10 +343,14 @@
<module>javacc-maven-plugin</module>
<module>gshell-parser</module>
<module>gshell-layout</module>
+ <!--
<module>gshell-plugin</module>
+ -->
<module>gshell-core</module>
<module>gshell-cli</module>
+ <!--
<module>gshell-maven-plugin</module>
+ -->
<module>gshell-commands</module>
<module>gshell-testsuite</module>
<module>gshell-assembly</module>
|