org.objectledge.container
Class Main

java.lang.Object
  extended by org.objectledge.container.Main

public class Main
extends Object

Allows running Ledge applications from the command line.

After the container is started and components are composed and configured, a designated component is looked up and method void main(String[]) is invoked on it. Note that it this mehtod should be non-static so it may take advantage of the actual component instance composed by the container.

Recognized commandline options

syntax required default description
-h no n/a Display usage information and exit
-v no n/a Display version information on startup
-r <root> no current working directory Root directory of Ledge FileSystem
-c <config> no /config Base directory of the system's configuration
<class-name> yes none Class name of the component to be invoked

Any command line arguments following the componen class name will be passed verbatim to the component's main method.

Dependencies

Created on Dec 22, 2003

Version:
$Id: Main.java,v 1.11 2005/07/07 08:30:02 zwierzem Exp $
Author:
rafal@caltha.pl

Field Summary
private static org.apache.commons.cli.Options options
           
protected static String VERSION
          version string.
 
Constructor Summary
private Main()
          A private constructor - this class should be used statically only.
 
Method Summary
private static void addShutdownHook(LedgeContainer ledgeContainer)
           
static void main(String[] args)
          Command line entry point.
protected static void printUsage()
          Prints usage infomration and exits.
protected static void printVersion()
          Prints version information.
static void run(String root, String config, String componentClassName, String[] componentArgs)
          Runns LedgeContainer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

protected static final String VERSION
version string.

See Also:
Constant Field Values

options

private static org.apache.commons.cli.Options options
Constructor Detail

Main

private Main()
A private constructor - this class should be used statically only.

Method Detail

main

public static void main(String[] args)
Command line entry point.

Parameters:
args - command line arguments.

printVersion

protected static void printVersion()
Prints version information.


printUsage

protected static void printUsage()
Prints usage infomration and exits.


run

public static void run(String root,
                       String config,
                       String componentClassName,
                       String[] componentArgs)
Runns LedgeContainer.

Parameters:
root - the file system root.
config - the configuration base directory.
componentClassName - the component to invoke.
componentArgs - the component arguments.

addShutdownHook

private static void addShutdownHook(LedgeContainer ledgeContainer)


Copyright © 2003-2006 objectledge.org. All Rights Reserved.