improved startup strategy & better status reporting
[cdmlib.git] / cdm-server / src / main / java / eu / etaxonomy / cdm / server / CommandOptions.java
1 // $Id$
2 /**
3 * Copyright (C) 2009 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
9 */
10
11 package eu.etaxonomy.cdm.server;
12
13 import org.apache.commons.cli.Option;
14 import org.apache.commons.cli.OptionBuilder;
15 import org.apache.commons.cli.Options;
16
17 public class CommandOptions{
18
19 private static Options options = null;
20
21 public static final Option HELP = new Option( "help", "print this message" );
22 public static final Option JMX = new Option( "jmx", "Start the server with the Jetty MBeans. " );
23
24 @SuppressWarnings("static-access")
25 public static final Option WEBAPP = OptionBuilder
26 .withArgName("file")
27 .hasArg()
28 .withDescription( "use the specified webapplication this either can be a compresses war or extracted file. " +
29 "If this options is used extraction of the war from the cdmserver jar file is omitted." +
30 "Developers can run the server completely from the traget folder or completly from source " +
31 "when using the following paths: \n" +
32 "'{cdmlib-project-root}/cdmlib-remote/target/cdmserver' " +
33 "'{cdmlib-project-root}/cdmlib-remote/src/main/webapp' " )
34 .create("webapp");
35
36 @SuppressWarnings("static-access")
37 public static final Option HTTP_PORT = OptionBuilder
38 .withArgName("httpPortNumber")
39 .hasArg()
40 .withDescription( "set the http listening port. Default is 8080")
41 .create("httpPort") ;
42
43 @SuppressWarnings("static-access")
44 public static final Option DATASOURCES_FILE = OptionBuilder
45 .withArgName("datasourcesfile")
46 .hasArg()
47 .withDescription( "use the specified datasources file. Default is {user.home}/.cdmLibrary/datasources.xml")
48 .create("datasources");
49
50
51
52 public static Options getOptions(){
53 if(options == null){
54 options = new Options();
55 options.addOption(HELP);
56 options.addOption(WEBAPP);
57 options.addOption(HTTP_PORT);
58 options.addOption(DATASOURCES_FILE);
59 options.addOption(JMX);
60 }
61 return options;
62 }
63
64
65 }