01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19:
20: package org.apache.geronimo.jaxws.builder;
21:
22: import org.apache.geronimo.gshell.command.CommandContext;
23: import org.apache.geronimo.gshell.command.CommandSupport;
24: import org.apache.geronimo.gshell.command.annotation.CommandComponent;
25: import org.apache.geronimo.gshell.command.annotation.Requirement;
26: import org.apache.geronimo.gshell.shell.ShellInfo;
27:
28: /**
29: * GShell command for wsgen tool.
30: *
31: * @version $Rev: 595889 $ $Date: 2007-11-16 20:13:06 -0500 (Fri, 16 Nov 2007) $
32: */
33: @CommandComponent(id="geronimo-jaxws-builder:wsgen",description="Generate JAX-WS artifacts from class")
34: public class WsgenCommand extends CommandSupport {
35:
36: @Requirement
37: ShellInfo shellInfo;
38:
39: @Override
40: public Object execute(final CommandContext context,
41: final Object... args) throws Exception {
42: init(context);
43:
44: String[] arguments = toString(args);
45: return JAXWSToolsCLI.run(JAXWSToolsCLI.Command.WSGEN, shellInfo
46: .getHomeDir().getAbsolutePath(), arguments, System.out); // should use io.out instead of System.out?
47: }
48:
49: @Override
50: protected Object doExecute() throws Exception {
51: return null;
52: }
53:
54: private static String[] toString(Object[] args) {
55: String[] a = new String[args.length];
56: for (int i = 0; i < a.length; i++) {
57: a[i] = args[i].toString();
58: }
59: return a;
60: }
61:
62: }
|