Return-Path: Delivered-To: apmail-openejb-commits-archive@www.apache.org Received: (qmail 92599 invoked from network); 1 Aug 2007 09:37:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Aug 2007 09:37:44 -0000 Received: (qmail 78418 invoked by uid 500); 1 Aug 2007 09:32:36 -0000 Delivered-To: apmail-openejb-commits-archive@openejb.apache.org Received: (qmail 77266 invoked by uid 500); 1 Aug 2007 09:31:42 -0000 Mailing-List: contact commits-help@openejb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openejb.apache.org Delivered-To: mailing list commits@openejb.apache.org Received: (qmail 76627 invoked by uid 99); 1 Aug 2007 09:31:07 -0000 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Aug 2007 02:31:05 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 09D451A981A; Wed, 1 Aug 2007 02:30:07 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r561741 - in /openejb/trunk/openejb3: container/openejb-core/src/main/java/org/apache/openejb/cli/ container/openejb-core/src/main/java/org/apache/openejb/config/ container/openejb-core/src/main/resources/META-INF/org.apache.openejb.cli/ se... Date: Wed, 01 Aug 2007 09:30:01 -0000 To: commits@openejb.apache.org From: dblevins@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070801093007.09D451A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dblevins Date: Wed Aug 1 02:29:58 2007 New Revision: 561741 URL: http://svn.apache.org/viewvc?view=rev&rev=561741 Log: Moved the start and stop command line commands to the openejb-server package where they belong Cleaned up the start command to use commons cli as well as updated it's options Removed all usage of System.exit in the various commands Added: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cli/SystemExitException.java openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb.cli/validate.disabled (contents, props changed) - copied, changed from r561107, openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb.cli/validate openejb/trunk/openejb3/server/openejb-server/src/main/resources/META-INF/org.apache.openejb.cli/ openejb/trunk/openejb3/server/openejb-server/src/main/resources/META-INF/org.apache.openejb.cli/start openejb/trunk/openejb3/server/openejb-server/src/main/resources/META-INF/org.apache.openejb.cli/start.examples openejb/trunk/openejb3/server/openejb-server/src/main/resources/META-INF/org.apache.openejb.cli/start.help openejb/trunk/openejb3/server/openejb-server/src/main/resources/META-INF/org.apache.openejb.cli/stop openejb/trunk/openejb3/server/openejb-server/src/main/resources/META-INF/org.apache.openejb.cli/stop.examples Removed: openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb.cli/deploy.examples openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb.cli/deploy.help openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb.cli/start openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb.cli/start.examples openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb.cli/start.help openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb.cli/stop openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb.cli/stop.examples openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb.cli/stop.help openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb.cli/validate Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cli/Bootstrap.java openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/Deploy.java openejb/trunk/openejb3/server/openejb-server/src/main/java/org/apache/openejb/server/Main.java Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cli/Bootstrap.java URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cli/Bootstrap.java?view=diff&rev=561741&r1=561740&r2=561741 ============================================================================== --- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cli/Bootstrap.java (original) +++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cli/Bootstrap.java Wed Aug 1 02:29:58 2007 @@ -98,7 +98,11 @@ Class clazz = Bootstrap.class.getClassLoader().loadClass(OPENEJB_CLI_MAIN_CLASS_NAME); Main main = (Main) clazz.newInstance(); - main.main(args); + try { + main.main(args); + } catch (SystemExitException e) { + System.exit(e.getExitCode()); + } } -} \ No newline at end of file +} Added: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cli/SystemExitException.java URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cli/SystemExitException.java?view=auto&rev=561741 ============================================================================== --- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cli/SystemExitException.java (added) +++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cli/SystemExitException.java Wed Aug 1 02:29:58 2007 @@ -0,0 +1,32 @@ +/** + * 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. + */ +package org.apache.openejb.cli; + +/** + * @version $Rev$ $Date$ + */ +public class SystemExitException extends Exception { + private final int exitCode; + + public SystemExitException(int exitCode) { + this.exitCode = exitCode; + } + + public int getExitCode() { + return exitCode; + } +} Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java?view=diff&rev=561741&r1=561740&r2=561741 ============================================================================== --- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java (original) +++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java Wed Aug 1 02:29:58 2007 @@ -124,7 +124,7 @@ chain.add(new InitEjbDeployments()); -// chain.add(new DebuggableVmHackery()); + chain.add(new DebuggableVmHackery()); chain.add(new CmpJpaConversion()); chain.add(new OpenEjb2Conversion()); Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/Deploy.java URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/Deploy.java?view=diff&rev=561741&r1=561740&r2=561741 ============================================================================== --- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/Deploy.java (original) +++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/Deploy.java Wed Aug 1 02:29:58 2007 @@ -25,6 +25,7 @@ import org.apache.commons.cli.ParseException; import org.apache.commons.cli.PosixParser; import org.apache.openejb.OpenEJBException; +import org.apache.openejb.cli.SystemExitException; import org.apache.openejb.loader.SystemInstance; import org.apache.openejb.assembler.Deployer; import org.apache.openejb.assembler.classic.AppInfo; @@ -58,7 +59,7 @@ private static final int BUF_SIZE = 8192; - public static void main(String[] args) { + public static void main(String[] args) throws SystemExitException { CommandLineParser parser = new PosixParser(); @@ -78,15 +79,15 @@ line = parser.parse(options, args); } catch (ParseException exp) { help(options); - System.exit(-1); + throw new SystemExitException(-1); } if (line.hasOption("help")) { help(options); - System.exit(0); + return; } else if (line.hasOption("version")) { OpenEjbVersion.get().print(System.out); - System.exit(0); + return; } if (line.getArgList().size() == 0) { @@ -102,7 +103,7 @@ String dir = line.getOptionValue("dir", "apps"); apps = SystemInstance.get().getBase().getDirectory(dir); } catch (IOException e) { - + throw new SystemExitException(-1); } if (!apps.exists()) { @@ -125,10 +126,10 @@ } catch (javax.naming.ServiceUnavailableException e) { System.out.println(e.getCause().getMessage()); System.out.println(messages.format("cmd.deploy.serverOffline")); - System.exit(1); + throw new SystemExitException(1); } catch (javax.naming.NamingException e) { System.out.println("DeployerEjb does not exist in server '" + serverUrl + "', check the server logs to ensure it exists and has not been removed."); - System.exit(2); + throw new SystemExitException(2); } int exitCode = 0; @@ -202,7 +203,9 @@ } } - System.exit(exitCode); + if (exitCode != 0){ + throw new SystemExitException(exitCode); + } } private static void checkSource(File file) throws DeploymentTerminatedException { Copied: openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb.cli/validate.disabled (from r561107, openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb.cli/validate) URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb.cli/validate.disabled?view=diff&rev=561741&p1=openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb.cli/validate&r1=561107&p2=openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb.cli/validate.disabled&r2=561741 ============================================================================== (empty) Propchange: openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb.cli/validate.disabled ------------------------------------------------------------------------------ svn:keywords = Date Rev Author Id Revision HeadURL Modified: openejb/trunk/openejb3/server/openejb-server/src/main/java/org/apache/openejb/server/Main.java URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/server/openejb-server/src/main/java/org/apache/openejb/server/Main.java?view=diff&rev=561741&r1=561740&r2=561741 ============================================================================== --- openejb/trunk/openejb3/server/openejb-server/src/main/java/org/apache/openejb/server/Main.java (original) +++ openejb/trunk/openejb3/server/openejb-server/src/main/java/org/apache/openejb/server/Main.java Wed Aug 1 02:29:58 2007 @@ -17,11 +17,25 @@ package org.apache.openejb.server; import java.io.File; -import java.io.InputStream; -import java.net.URL; +import java.io.IOException; import java.util.Properties; +import java.util.Map; +import java.util.Set; +import java.util.Collections; import org.apache.openejb.loader.SystemInstance; +import org.apache.openejb.util.OpenEjbVersion; +import org.apache.openejb.util.Messages; +import org.apache.openejb.cli.SystemExitException; +import org.apache.commons.cli.CommandLineParser; +import org.apache.commons.cli.PosixParser; +import org.apache.commons.cli.Options; +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.ParseException; +import org.apache.commons.cli.HelpFormatter; +import org.apache.commons.cli.Option; +import org.apache.commons.cli.OptionBuilder; +import org.apache.xbean.finder.ResourceFinder; /** * Assemble OpenEJB instance and boot it up @@ -30,154 +44,115 @@ */ public class Main { - private static final String HELP_BASE = "META-INF/org.apache.openejb.cli/"; + private static Messages messages = new Messages(Main.class); - public static void main(String args[]) { + public static void main(String args[]) throws SystemExitException { + CommandLineParser parser = new PosixParser(); + // create the Options + Options options = new Options(); + options.addOption(option("v", "version", "cmd.start.opt.version")); + options.addOption(option("h", "help", "cmd.start.opt.help")); + options.addOption(option(null, "conf", "file", "cmd.start.opt.conf")); + options.addOption(option(null, "local-copy", "boolean", "cmd.start.opt.localCopy")); + options.addOption(option(null, "examples", "cmd.start.opt.examples")); + + ResourceFinder finder = new ResourceFinder("META-INF/"); + + Set services = null; + try { + Map serviceEntries = finder.mapAvailableProperties(ServerService.class.getName()); + services = serviceEntries.keySet(); + for (String service : services) { + options.addOption(option(null, service+"-port", "int", "cmd.start.opt.port", service)); + options.addOption(option(null, service+"-bind", "host", "cmd.start.opt.bind", service)); + } + } catch (IOException e) { + services = Collections.EMPTY_SET; + } + + CommandLine line = null; try { - Properties props = parseArguments(args); - SystemInstance.init(props); - SystemInstance system = SystemInstance.get(); - File libs = system.getHome().getDirectory("lib"); - system.getClassPath().addJarsToPath(libs); - initServer(props); - } catch (DontStartServerException ignored) { - } catch (Exception e) { - e.printStackTrace(); + // parse the command line arguments + line = parser.parse(options, args); + } catch (ParseException exp) { + help(options); + throw new SystemExitException(-1); } - } - /** - * Parse arguments and override any {@link System} properties returned via - * {@link System#getProperties()}. - * - * @param args - * command line arguments - * @return properties as defined in System and on the command line - * @throws DontStartServerException - * thrown as an indication to not boot up OpenEJB instance, e.g. - * after printing out properties, help, etc. - */ - private static Properties parseArguments(String args[]) throws DontStartServerException { - Properties props = new Properties(); - props.putAll(System.getProperties()); - - props.put("openejb.server.ip", "127.0.0.1"); - props.put("openejb.server.port", "4201"); - props.put("openejb.server.threads", "20"); - - for (int i = 0; i < args.length; i++) { - if (args[i].equals("-h")) { - if (args.length > i + 1) { - props.setProperty("openejb.server.ip", args[++i]); - } - } else if (args[i].equals("-p")) { - if (args.length > i + 1) { - props.setProperty("openejb.server.port", args[++i]); - } - } else if (args[i].equals("-t")) { - if (args.length > i + 1) { - props.setProperty("openejb.server.threads", args[++i]); - } - } else if (args[i].equals("-conf")) { - if (args.length > i + 1) { - props.setProperty("openejb.configuration", args[++i]); - } - } else if (args[i].equals("-l")) { - if (args.length > i + 1) { - props.setProperty("log4j.configuration", args[++i]); - } - } else if (args[i].equals("-d")) { - if (args.length > i + 1) { - props.setProperty("openejb.home", args[++i]); - } - } else if (args[i].equals("--admin-ip")) { - if (args.length > i + 1) { - props.setProperty("openejb.server.admin-ip", args[++i]); - } - } else if (args[i].startsWith("--local-copy")) { - if (args[i].endsWith("false") || args[i].endsWith("FALSE") || args[i].endsWith("no") - || args[i].endsWith("NO")) { - props.setProperty("openejb.localcopy", "false"); - } else { - props.setProperty("openejb.localcopy", "true"); - } - } else if (args[i].equals("--help")) { - printHelp(); - throw new DontStartServerException(); - } else if (args[i].equals("-version")) { - printVersion(); - throw new DontStartServerException(); - } else if (args[i].equals("-examples")) { - printExamples(); - throw new DontStartServerException(); + if (line.hasOption("help")) { + help(options); + return; + } else if (line.hasOption("version")) { + OpenEjbVersion.get().print(System.out); + return; + } else if (line.hasOption("examples")) { + try { + String text = finder.findString("org.apache.openejb.cli/start.examples"); + System.out.println(text); + return; + } catch (IOException e) { + System.err.println("Unable to print examples:"); + e.printStackTrace(); + throw new SystemExitException(-2); } } - props.setProperty("org/openejb/configuration_factory", "org.apache.openejb.config.ConfigurationFactory"); + Properties props = SystemInstance.get().getProperties(); - return props; - } + if (line.hasOption("conf")) { + props.setProperty("openejb.configuration", line.getOptionValue("conf")); + } else if (line.hasOption("local-copy")) { + String value = line.getOptionValue("local-copy"); + if (value.equalsIgnoreCase("false") || value.equalsIgnoreCase("no") || value.equalsIgnoreCase("off")) { + props.setProperty("openejb.localcopy", "false"); + } else { + props.setProperty("openejb.localcopy", "true"); + } + } - private static void printVersion() { - /* - * Output startup message - */ - Properties versionInfo = new Properties(); + for (String service : services) { + String[] opts = {"port", "bind"}; + for (String opt : opts) { + String option = service + "-" + opt; + if (line.hasOption(option)){ + props.setProperty(service+"."+opt, line.getOptionValue(option)); + } + } + } try { - versionInfo.load(new URL("resource:/openejb-version.properties").openConnection().getInputStream()); - } catch (java.io.IOException e) {} - System.out.println("OpenEJB Remote Server " + versionInfo.get("version") + " build: " - + versionInfo.get("date") + "-" + versionInfo.get("time")); - System.out.println("" + versionInfo.get("url")); + SystemInstance system = SystemInstance.get(); + File libs = system.getHome().getDirectory("lib"); + system.getClassPath().addJarsToPath(libs); + initServer(); + } catch (DontStartServerException ignored) { + } catch (Exception e) { + e.printStackTrace(); + } } - private static void printHelp() { - String header = "OpenEJB Remote Server "; - try { - Properties versionInfo = new Properties(); - versionInfo.load(new URL("resource:/openejb-version.properties").openConnection().getInputStream()); - header += versionInfo.get("version"); - } catch (java.io.IOException e) {} - - System.out.println(header); - - try { - InputStream in = Thread.currentThread().getContextClassLoader().getResource(HELP_BASE + "start.help").openConnection().getInputStream(); - - int b = in.read(); - while (b != -1) { - System.out.write(b); - b = in.read(); - } - } catch (java.io.IOException e) {} + private static void help(Options options) { + HelpFormatter formatter = new HelpFormatter(); + formatter.printHelp("start [options]", "\n"+i18n("cmd.start.description"), options, "\n"); } - private static void printExamples() { - String header = "OpenEJB Remote Server "; - try { - Properties versionInfo = new Properties(); - versionInfo.load(new URL("resource:/openejb-version.properties").openConnection().getInputStream()); - header += versionInfo.get("version"); - } catch (java.io.IOException e) {} - - System.out.println(header); + private static Option option(String shortOpt, String longOpt, String description) { + return OptionBuilder.withLongOpt(longOpt).withDescription(i18n(description)).create(shortOpt); + } - try { - InputStream in = Thread.currentThread().getContextClassLoader().getResource(HELP_BASE + "start.examples").openConnection().getInputStream(); + private static Option option(String shortOpt, String longOpt, String argName, String description, Object... details) { + return OptionBuilder.withLongOpt(longOpt).withArgName(argName).hasArg().withDescription(i18n(description)).create(shortOpt); + } - int b = in.read(); - while (b != -1) { - System.out.write(b); - b = in.read(); - } - } catch (java.io.IOException e) {} + private static String i18n(String key, Object... details) { + return messages.format(key, details); } - private static void initServer(Properties props) throws Exception { + + private static void initServer() throws Exception { Server server = new Server(); - server.init(props); + server.init(SystemInstance.get().getProperties()); server.start(); } } Added: openejb/trunk/openejb3/server/openejb-server/src/main/resources/META-INF/org.apache.openejb.cli/start URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/server/openejb-server/src/main/resources/META-INF/org.apache.openejb.cli/start?view=auto&rev=561741 ============================================================================== --- openejb/trunk/openejb3/server/openejb-server/src/main/resources/META-INF/org.apache.openejb.cli/start (added) +++ openejb/trunk/openejb3/server/openejb-server/src/main/resources/META-INF/org.apache.openejb.cli/start Wed Aug 1 02:29:58 2007 @@ -0,0 +1,20 @@ +# 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. +# +main.class = org.apache.openejb.server.Main +name = start +description = Start the OpenEJB Remote Server for accessing beans in client/server mode. +description.pl = Uruchom OpenEJB Remote Server udost\u0119pniaj\u0105c komponenty EJB w trybie klient/serwer. + Added: openejb/trunk/openejb3/server/openejb-server/src/main/resources/META-INF/org.apache.openejb.cli/start.examples URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/server/openejb-server/src/main/resources/META-INF/org.apache.openejb.cli/start.examples?view=auto&rev=561741 ============================================================================== --- openejb/trunk/openejb3/server/openejb-server/src/main/resources/META-INF/org.apache.openejb.cli/start.examples (added) +++ openejb/trunk/openejb3/server/openejb-server/src/main/resources/META-INF/org.apache.openejb.cli/start.examples Wed Aug 1 02:29:58 2007 @@ -0,0 +1,151 @@ +Usage: openejb start [options] + +Example: Simplest scenario + + openejb start + + That's it. The ejbd will start up and bind to IP 127.0.0.1 and port 4201. + + The following properties would then be used to get an InitialContext + from the Remote Server. + + java.naming.factory.initial = org.apache.openejb.client.RemoteInitialContextFactory + java.naming.provider.url = ejbd://127.0.0.1:4201 + java.naming.security.principal = myuser + java.naming.security.credentials = mypass + +Example: --conf=file + + openejb start --conf=C:\openejb\conf\mytest.conf + + Sets the openejb.configuration system variable to the file + C:\openejb\conf\mytest.conf. When the server starts up and + the initializes OpenEJB, this configuration will be + used to assemble the container system and load beans. + +Example: --local-copy + + openejb start --local-copy=true + + Instructs the container system to marshal (ie, copy) all + calls between beans are required by the EJB 1.1 specification. + + openejb start --local-copy=false + + Instructs the container system to not marshal (copy) calls + between beans. The container system as will pass parameters + and return values without copying or marshalling as is + required for EJB 2.0 Local interfaces. + + +CONFIG OVERRIDE EXAMPLES + + +Example: -D.bind=
+ + openejb start -Dejbd.bind=10.45.67.8 + + This is the most common way to use the EJBd Server Service. The service will start + up and bind to IP 10.45.67.8 and port 4201. + + The following properties would then be used to get an InitialContext + from the EJBd Server Service. + + java.naming.factory.initial = org.apache.openejb.client.RemoteInitialContextFactory + java.naming.provider.url = ejbd://10.45.67.8:4201 + java.naming.security.principal = myuser + java.naming.security.credentials = mypass + + DNS names can also be used. + + openejb start -Dejbd.bind=myhost.foo.com + + The following properties would then be used to get an InitialContext + from the Remote Server. + + java.naming.factory.initial = org.apache.openejb.client.RemoteInitialContextFactory + java.naming.provider.url = ejbd://myhost.foo.com:4201 + java.naming.security.principal = myuser + java.naming.security.credentials = mypass + + openejb start -Dtelnet.bind=myhost.foo.com + + The following properties would then be used to log into the server + via a telnet client as such: + + telnet myhost.foo.com 4202 + + +Example: -D.port= + + openejb start -Dejbd.port=8765 + + The server will start up and bind to IP 127.0.0.1 and port 8765. + + The following properties would then be used to get an InitialContext + from the Remote Server. + + java.naming.factory.initial = org.apache.openejb.client.RemoteInitialContextFactory + java.naming.provider.url = ejbd://127.0.0.1:8765 + java.naming.security.principal = myuser + java.naming.security.credentials = mypass + + openejb start -Dhttpejbd.port=8888 + + The server will start up and the EJB over HTTP service will bind + to IP 127.0.0.1 and port 8888. + + The following properties would then be used to get an InitialContext + from the HTTP/Remote Server. + + java.naming.factory.initial = org.apache.openejb.client.RemoteInitialContextFactory + java.naming.provider.url = http://127.0.0.1:8888/openejb + java.naming.security.principal = myuser + java.naming.security.credentials = mypass + + +Example: -D.only_from= + + openejb start -Dadmin.only_from=192.168.1.12 + + Adds 192.168.1.12 to the list of IP addresses that are + authorized to shutdown the server or access the server + via a telnet client. The host that this server was + started on is always allowed to administer the server. + + Multiple hosts can be given administrative access to + this server by listing all the host names separated + by commas as such: + + openejb start -Dadmin.only_from=192.168.1.12,joe.foo.com,robert + + The first host in the string names the host explicitly + using an IP address (192.168.1.12). + + The second host in uses a DNS name (joe.foo.com) to refer + to the hosts IP address. The DNS name will be resolved + and the IP will be added to the admin list. + + The third address refers to a the host by a name (robert) + that the opperating system is able to resolve into a valid + IP address. This is usually done via a hosts file, interal + DNS server, or Windows Domain Server. + + +Example: -D.threads= + + openejb start -Dejbd.threads=200 + + Sets the max number of concurrent threads that can enter the + EJBd Server Service to 200. + + +Example: -D.disabled= + + openejb start -Dtelnet.disabled=true + + Prevents the Telnet Server Service from starting when the + OpenEJB Server starts. + + +Bug Reports to Added: openejb/trunk/openejb3/server/openejb-server/src/main/resources/META-INF/org.apache.openejb.cli/start.help URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/server/openejb-server/src/main/resources/META-INF/org.apache.openejb.cli/start.help?view=auto&rev=561741 ============================================================================== --- openejb/trunk/openejb3/server/openejb-server/src/main/resources/META-INF/org.apache.openejb.cli/start.help (added) +++ openejb/trunk/openejb3/server/openejb-server/src/main/resources/META-INF/org.apache.openejb.cli/start.help Wed Aug 1 02:29:58 2007 @@ -0,0 +1,55 @@ +Usage: openejb start [options] + +Starts OpenEJB as an EJB Server that can be accessed by remote +clients via the OpenEJB Remote Server. + +ALWAYS check your openejb.log file for warnings immediately after +starting the Remote Server. + +OpenEJB issues warnings when it works around a potential problem, +encounters something it didn't expect, or when OpenEJB wants to +let you know something may not work as you expected it. + +OPTIONS + -h host Binds the Remote Server to the specified host address. + Default host address is 127.0.0.1. + + -p port Binds the Remote Server to the specified port. + Default port is 4201. + + -t int Sets the number of concurrent threads the Remote + server should use to service requests from clients. + Default number of threads is 20. + + -d dir Sets the OPENEJB_HOME to the specified directory. + + -l file Sets the log4j configuration to the specified file. + + -conf file Sets the OpenEJB configuration to the specified file. + + -version Print the version. + + -help Print this help message. + + -examples Show examples of how to use the options. + + --admin-ip A comma delimited list of hosts and IP addresses that + are allowed to administer this server. + + --local-copy=[true|false] + + When set to true, the container system will marshall + (ie, copy) all calls between beans are required by + the EJB 1.1 specification. When set to false, the + container system will pass parameters and return + values without copying or marshalling as is required + for EJB 2.0 Local interfaces. Default is true. + + +See http://incubator.apache.org/openejb/remote-server.html for more information. + +OpenEJB -- EJB Container System and EJB Server. +For OpenEJB updates and additional information, visit +http://incubator.apache.org/openejb + +Bug Reports to Added: openejb/trunk/openejb3/server/openejb-server/src/main/resources/META-INF/org.apache.openejb.cli/stop URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/server/openejb-server/src/main/resources/META-INF/org.apache.openejb.cli/stop?view=auto&rev=561741 ============================================================================== --- openejb/trunk/openejb3/server/openejb-server/src/main/resources/META-INF/org.apache.openejb.cli/stop (added) +++ openejb/trunk/openejb3/server/openejb-server/src/main/resources/META-INF/org.apache.openejb.cli/stop Wed Aug 1 02:29:58 2007 @@ -0,0 +1,20 @@ +# 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. +# +main.class = org.apache.openejb.server.admin.Stop +name = stop +description = Stop the OpenEJB Remote Server. +description.pl = Zatrzymaj OpenEJB Remote Server. + Added: openejb/trunk/openejb3/server/openejb-server/src/main/resources/META-INF/org.apache.openejb.cli/stop.examples URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/server/openejb-server/src/main/resources/META-INF/org.apache.openejb.cli/stop.examples?view=auto&rev=561741 ============================================================================== --- openejb/trunk/openejb3/server/openejb-server/src/main/resources/META-INF/org.apache.openejb.cli/stop.examples (added) +++ openejb/trunk/openejb3/server/openejb-server/src/main/resources/META-INF/org.apache.openejb.cli/stop.examples Wed Aug 1 02:29:58 2007 @@ -0,0 +1,28 @@ +Usage: openejb stop [options] + +Example: Simplest scenario + + openejb stop + + That's it. This connects to the server running on the default host + address (127.0.0.1) and port (4201) and sends it a stop request. + +Example: -h + + openejb stop -h 10.45.67.8 + + Sends a stop request to the server running on IP 10.45.67.8 and port 4201. + + DNS names can also be used. + + openejb stop -h myhost.foo.com + + Sends a stop request to the server running on myhost.foo.com and port 4201. + +Example: -p + + openejb stop -p 8765 + + Sends a stop request to the server running on IP 127.0.0.1 and port 8765. + +Bug Reports to