| This class is used by
$COUGAAR_INSTALL_PATH/bin/cougaar[.bat]
to read the configuration XML files and print the java
command line, which is then used to launch the Cougaar node
process.
For usage, see the
CommandLine.USAGE string, or run:
$COUGAAR_INSTALL_PATH/bin/cougaar --help
The typical usage is:
# start node X specified in "mySociety.xml":
cd your_config_directory
$COUGAAR_INSTALL_PATH/bin/cougaar mySociety.xml X
This class is intended to replace the old Cougaar scripts:
Node, Node.bat, XMLNode.bat, XSLNode, XSLNode.bat
The behavior is backwards-compatible with XSLNode.
For example, the input files and command line:
mySociety.xml:
<?xml version='1.0'?>
<society name='MinPing' ..>
<node name='NodeA'>
<vm_parameter>-Dx=y</vm_parameter>
<vm_parameter>-Dfoo=$bar</vm_parameter>
</node>
</society>
myRuntime.xml:
<?xml version='1.0'?>
<vm_parameters>
<vm_parameter>-Dx=z</vm_parameter>
..
</vm_parameters>
command line:
$COUGAAR_INSTALL_PATH/bin/cougaar \
--society mySociety.xml\
--runtime myRuntime.xml\
NodeA
would print a command line output similar to:
java -Dx=z -Dfoo=$bar ...
and on Windows (based on the 'os.name' property) this would be:
java -Dx=z -Dfoo=%bar% ...
This parser also adds several standard Cougaar defaults, which
add the minimal -Ds and options required to run a Cougaar node:
- If the <command> is not specified in either the
society_xml or optional runtime_xml, "java" is used.
- If the <class> is not specified in either xml,
"org.cougaar.bootstrap.Bootstrapper" is used. The
following "-Ds" rules are only executed if the "Bootstrapper"
class is specified:
- If zero <prog_parameter>s are specified,
and "-Dorg.cougaar.bootstrap.application=classname"
is not specified in either xmls or command-line arguments,
then
"-Dorg.cougaar.bootstrap.application=org.cougaar.core.node.Node"
is used. The following "-D" rules are only executed if
the "Node" bootstrapped class is specified (plus the above
"Bootstrapper" class requirement):
- If "-Dorg.cougaar.runtime.file=filename" is not
specified, and a runtime_xml was specified on the command line, then
"-Dorg.cougaar.runtime.file=runtime_xml
is used.
- If "-Dorg.cougaar.society.file=filename" is not
specified,
"-Dorg.cougaar.society.file=society_xml
is used.
- If "-Dorg.cougaar.node.name=node_name is not
specified, then the <node name='..'> of the
first node listed in the aplication_xml is
used, otherwise the first node name listed in the runtime_xml
is used.
- If the "-Dorg.cougaar.runtime.path=directory is not
specified, then
"-Dorg.cougaar.runtime.path=$COUGAAR_RUNTIME_PATH"
is used.
- If the "-Dorg.cougaar.society.path=directory is not
specified, then
"-Dorg.cougaar.society.path=$COUGAAR_SOCIETY_PATH"
is used.
- If the "-Dorg.cougaar.install.path=directory is not
specified, then
"-Dorg.cougaar.install.path=$COUGAAR_INSTALL_PATH"
is used.
- If a "-Xbootclasspath.." is not specified, then
"-Xbootclasspath/p:$COUGAAR_INSTALL_PATH/lib/javaiopatch.jar"
is used.
- If
"-Dorg.cougaar.core.node.InitializationComponent=type"
is not specified,
"-Dorg.cougaar.core.node.InitializationComponent=XML"
is used.
- If "-Djava.class.path=jars" is not specified,
"-Djava.class.path=$COUGAAR_INSTALL_PATH/lib/bootstrap.jar"
is used.
|