Package jade
Class Boot3
- java.lang.Object
-
- jade.Boot3
-
public class Boot3 extends Object
Boots JADE system, parsing command line arguments in the old (3.x) style.- Version:
- $Date$ $Revision$
- Author:
- Giovanni Rimassa - Universita' di Parma, Dick Cowan - HP Labs
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheck()This method verifies the configuration properties and eventually correct them.ExtendedPropertiesgetProperties()Get boot properties.protected booleanisFileName(String arg)Test if an argument actually references a file.voidlistProperties(PrintStream out)List boot properties to provided print stream.static voidmain(String[] args)Main entry point for invocation.protected String[]prepareArgs(String[] args)Transform original style boot arguments to new form.voidsetProperties(ExtendedProperties updates)Set boot properties.voidusage(PrintStream out)Show usage information.
-
-
-
Constructor Detail
-
Boot3
public Boot3(String[] args)
Constructor. Starts Jade with provided arguments.- Parameters:
args- The command line arguments. These use the form key:value
-
-
Method Detail
-
main
public static void main(String[] args)
Main entry point for invocation.- Parameters:
args- The command line arguments. These use the form key:value or -key (shorthand for key:true).
-
prepareArgs
protected String[] prepareArgs(String[] args)
Transform original style boot arguments to new form.In the following 'x' and 'y' denote arbitrary strings; 'n' an integer. Transformation Rules: Original New ------------------------------ -host x host:x -owner x owner:x -name x name:x -port n port:n -mtp x mtp:x -aclcodec:x aclcodec:x -conf x import:x -conf -conf -container -container -gui -gui -version -version -v -version -help -help -h -help -nomtp -nomtp -nomobility -nomobility -y x y:x agent list agents:agent list
If the arguments contain either import:x or agents:x we will assume that the arguments are already in the new format and leave them alone. For "import:" we test if what follows is a file name and in the event it isn't we assume that it was if there are any other "-x" options following.You can't mix the old form with the new as this would make the distinction between foo:bar as meaning a property named foo with a value bar or an agent named foo implmented by class bar impossible.
- Parameters:
args- The command line arguments.
-
isFileName
protected boolean isFileName(String arg)
Test if an argument actually references a file.- Parameters:
arg- The argument to test.- Returns:
- True if it does, false otherwise.
-
usage
public void usage(PrintStream out)
Show usage information.- Parameters:
out- The print stream to output to.
-
listProperties
public void listProperties(PrintStream out)
List boot properties to provided print stream.- Parameters:
out- PrintStream to list properties to.
-
getProperties
public ExtendedProperties getProperties()
Get boot properties.- Returns:
- ExtendedProperties Boot properties.
-
setProperties
public void setProperties(ExtendedProperties updates) throws BootException
Set boot properties. Copies provided properties over existing ones.- Parameters:
updates- Properties to be copied.- Throws:
BootException
-
check
protected void check() throws BootExceptionThis method verifies the configuration properties and eventually correct them. It checks if the port number is a number greater than 0 otherwise it throws a BootException, and if the -nomtp has been set, then delete some other mtp wrongly set. If the user wants to start a platform the host must be the local host so if a different name is speficied it will be corrected and an exception will be thrown.- Throws:
BootException- if anything is found to be inconsistent.
-
-