|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.tools.Boot
Starts multiple applications using seperate classloaders.
This allows multiple applications to co-exist even if they typicaly could not due to
class version problems. Each application is started in it's own thread.
Usage is Boot [-debug] -cp app-classpath app-class-name app-arguments ( , -cp app-classpath app-class-name app-arguments )*
Where:
app-classpath is a comma seperated URL form classpath to the application classes.
app-class-name is the class that will be started
app-arguments will be the String[] that will be passed to the main method of the application class
Jboss + Another Application boot example:
Boot -cp file:run.jar org.jboss.Main default , -cp file:./myapp.jar,file:./util.jar test.App2TEST arg1 arg2
Would start the JBoss Server using the default configuration and it would
start the test.App2TEST application.
Important Note: Notice that there are spaces before and after the ","!!!
You can now boot other applications via ths Boot class from withing one of the applications
that was booted by the Boot.
Example usage:
Boot b = Boot.getInstance();
Boot.ApplicationBoot ab = b.createApplicationBoot();
ab.applicationClass = "org.jboss.Main"
ab.classpath.add(new URL("file:run.jar"));
ab.args.add("default");
// this would start the application in a new thread.
b.startApplication( ab );
// Would boot the appp in the current thread.
ab.boot();
Nested Class Summary | |
class |
Boot.ApplicationBoot
Represents an application that can be booted. |
protected static class |
Boot.InvalidCommandLineException
|
Field Summary | |
protected LinkedList |
applicationBoots
For each booted application, we will store a ApplicationBoot object in this linked list. |
protected static String |
BOOT_APP_SEPERATOR
|
protected static String |
CP
|
protected static String |
HELP
|
protected boolean |
verbose
Indicates whether this instance is running in debug mode. |
protected static String |
VERBOSE
|
Constructor Summary | |
protected |
Boot()
If boot is accessed via an API, force the use of the getInstance() method. |
Method Summary | |
Boot.ApplicationBoot |
createApplicationBoot()
This can be used to boot another application From within another one. |
static Boot |
getInstance()
|
Boot.ApplicationBoot[] |
getStartedApplications()
|
static void |
main(String[] args)
Main entry point when called from the command line |
protected Boot.ApplicationBoot |
processAppBootCommandLine(LinkedList args)
Processes the command line argumenst for the next application on the command line. |
protected void |
processBootOptions(LinkedList args)
Processes to global options. |
protected LinkedList |
processCommandLine(LinkedList args)
Processes the Boot class's command line arguments |
protected static void |
showUsage()
|
void |
startApplication(Boot.ApplicationBoot bootData)
Boots the application in a new threadgroup and thread. |
static void |
systemExit(String[] argv)
This method is here so that if JBoss is running under Alexandria (An NT Service Installer), Alexandria can shutdown the system down correctly. |
protected void |
verbose(String msg)
logs verbose message to the console |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected boolean verbose
protected LinkedList applicationBoots
protected static final String HELP
protected static final String VERBOSE
protected static final String BOOT_APP_SEPERATOR
protected static final String CP
Constructor Detail |
protected Boot()
Method Detail |
public static Boot getInstance()
public Boot.ApplicationBoot createApplicationBoot()
public void startApplication(Boot.ApplicationBoot bootData) throws Exception
bootData
- the application to boot.
thrown
- if a problem occurs during launching
Exception
public Boot.ApplicationBoot[] getStartedApplications()
protected void verbose(String msg)
public static void main(String[] args)
args
- the command line argumentspublic static void systemExit(String[] argv)
protected LinkedList processCommandLine(LinkedList args) throws Exception
args
- the command line arguments
Exception
protected void processBootOptions(LinkedList args) throws Exception
args
- the command line arguments
Exception
protected static void showUsage()
protected Boot.ApplicationBoot processAppBootCommandLine(LinkedList args) throws Exception
args
- the command line arguments
Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |