站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 varia API Documentation 英文版文档

Boot (Various API) - JBoss 4.0.1 sp1 varia API Documentation 英文版文档


org.jboss.tools
Class Boot

java.lang.Object
  extended byorg.jboss.tools.Boot

public class Boot
extends Object

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();

Author:
Hiram Chirino

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

verbose

protected boolean verbose
Indicates whether this instance is running in debug mode.


applicationBoots

protected LinkedList applicationBoots
For each booted application, we will store a ApplicationBoot object in this linked list.


HELP

protected static final String HELP
See Also:
Constant Field Values

VERBOSE

protected static final String VERBOSE
See Also:
Constant Field Values

BOOT_APP_SEPERATOR

protected static final String BOOT_APP_SEPERATOR

CP

protected static final String CP
See Also:
Constant Field Values
Constructor Detail

Boot

protected Boot()
If boot is accessed via an API, force the use of the getInstance() method.

Method Detail

getInstance

public static Boot getInstance()

createApplicationBoot

public Boot.ApplicationBoot createApplicationBoot()
This can be used to boot another application From within another one.


startApplication

public void startApplication(Boot.ApplicationBoot bootData)
                      throws Exception
Boots the application in a new threadgroup and thread.

Parameters:
bootData - the application to boot.
Throws:
thrown - if a problem occurs during launching
Exception

getStartedApplications

public Boot.ApplicationBoot[] getStartedApplications()

verbose

protected void verbose(String msg)
logs verbose message to the console


main

public static void main(String[] args)
Main entry point when called from the command line

Parameters:
args - the command line arguments

systemExit

public 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.


processCommandLine

protected LinkedList processCommandLine(LinkedList args)
                                 throws Exception
Processes the Boot class's command line arguments

Parameters:
args - the command line arguments
Returns:
a linked list with ApplicationBoot objects
Throws:
Exception

processBootOptions

protected void processBootOptions(LinkedList args)
                           throws Exception
Processes to global options.

Parameters:
args - the command line arguments
Throws:
Exception

showUsage

protected static void showUsage()

processAppBootCommandLine

protected Boot.ApplicationBoot processAppBootCommandLine(LinkedList args)
                                                  throws Exception
Processes the command line argumenst for the next application on the command line.

Parameters:
args - the command line arguments
Throws:
Exception


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.