Um, on a related note, I think that *most* of the geronimo-commands
that are currently implemented in Groovy really shouldn't be. They
are rather small, don't really use much of the Groovy language
advantages, and seems like they also suffer from cut-and-paste atrophy.
A few of the commands still warrant their Groovy implementation, like
start-server (or really any of the process-launching commands)... all
others do not.
In the process of porting over to the latest GShell API's I'm
converting these classes back to Java impls.
--jason
On Dec 3, 2008, at 5:49 PM, Jason Dillon wrote:
For example your WsgenCommand.java becomes:
<snip>
package org.apache.geronimo.jaxws.builder;
import org.apache.geronimo.gshell.command.CommandAction;
import org.apache.geronimo.gshell.command.CommandContext;
import org.apache.geronimo.gshell.command.Arguments;
import org.apache.geronimo.gshell.application.Application;
/**
* GShell command for wsgen tool.
*
* @version $Rev: 595889 $ $Date: 2007-11-16 20:13:06 -0500 (Fri, 16
Nov 2007) $
*/
public class WsgenCommand
implements CommandAction
{
private Application app;
public WsgenCommand(final Application app) {
assert app != null;
this.app = app;
}
public Object execute(final CommandContext context) throws
Exception {
assert context != null;
return JAXWSToolsCLI.run(JAXWSToolsCLI.Command.WSGEN,
app.getHomeDir().getAbsolutePath(),
Arguments.toStringArray(context.getArguments()),
context.getIo().outputStream);
}
}
</snip>
And then the geronimo-jaxws-sun-tools jar gets a
META-INF/gshell/components.xml with:
<snip>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gshell="http://gshell.org/schema/wisdom-gshell"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://gshell.org/schema/wisdom-gshell
http://gshell.org/schema/wisdom-gshell/wisdom-gshell.xsd"
default-autowire="no"
default-dependency-check="none"
default-init-method="init"
default-destroy-method="destroy">
<gshell:plugin name="geronimo-jaxws-sun-tools">
<gshell:command-bundle name="default">
<gshell:command name="jaxws/wsgen" type="stateless">
<gshell:action
class="org.apache.geronimo.jaxws.builder.WsgenCommand">
<constructor-arg ref="application"/>
</gshell:action>
</gshell:command>
<gshell:command name="jaxws/wsimport" type="stateless">
<gshell:action
class="org.apache.geronimo.jaxws.builder.WsimportCommand">
<constructor-arg ref="application"/>
</gshell:action>
</gshell:command>
</gshell:command-bundle>
</gshell:plugin>
</beans>
</snip>
And finally 2 resource bundle files for i18n of the descriptions (one
for WsgenCommand and another for WsimportCommand).
From the gshell this plugin can be installed either by adding the
dependency to etc/application.xml or dynamically by running the
'admin/install-plugin' command.
--jason
On Mon, Dec 1, 2008 at 10:31 PM, Jarek Gawor <[EMAIL PROTECTED]> wrote:
Jason,
Will the existing gshell commands need to be updated to work with the
latest gshell?
Jarek
On Fri, Nov 28, 2008 at 4:59 AM, Jason Dillon <[EMAIL PROTECTED]>
wrote:
Is there any release planned for server/trunk soonerish? I ask
because I'm
about ready to release GShell 1.0-alpha-2, and I'd like to update
server/trunk to use its awesome goodness. Anyone see any problems
with
that?
--jason