Basic usage is something like this: - *
- * // setup the basic server config properties - * Properties props = new Properties(System.getProperties()); - * props.put(ServerConfig.SERVER_LIBRARY_URL, "http://myserver.com/myjboss/lib/"); - * // set some more properties - * - * // create a new loader to do the dirty work - * ServerLoader loader = new ServerLoader(props); - * - * // add the jaxp & jmx library to use - * loader.addLibrary("crimson.jar"); - * loader.addLibrary("jboss-jmx-core.jar"); - * - * // load and initialize the server instance - * ClassLoader parent = Thread.currentThread().getContextClassLoader(); - * Server server = loader.load(parent); - * server.init(props); - * - * // start up the server - * server.start(); - * - * // go make some coffee, drink a beer or play GTA3 - * // ... - * - * // shutdown and go to sleep - * server.shutdown(); - *- * @version $Revision$ - * @author Jason Dillon - * @author Adrian Brock - * @author Scott.Stark@jboss.org - * @author Thomas.Diesler@jboss.org - */ -public class ServerLoader -{ - /** - * The default list of boot libraries. Does not include - * the JAXP or JMX impl, users of this class should add the - * proper libraries. - * TODO: use vfs to list the root directory - */ - public static final String[] DEFAULT_BOOT_LIBRARY_LIST = { - // Logging - "log4j-boot.jar", - "jboss-logging-spi.jar", - "jboss-logging-log4j.jar", - "jboss-logging-jdk.jar", - "jboss-logmanager.jar", - "jboss-logbridge.jar", - // Common jars - "jboss-common-core.jar", - "jboss-xml-binding.jar", - "jaxb-api.jar", - // Bootstrap - "jboss-bootstrap.jar", - // Microcontainer - "javassist.jar", - "jboss-reflect.jar", - "jboss-mdr.jar", - "jboss-dependency.jar", - "jboss-kernel.jar", - "jboss-metatype.jar", - "jboss-managed.jar", - // Fixme ClassLoading - "jboss-vfs.jar", - "jboss-classloading-spi.jar", - "jboss-classloader.jar", - "jboss-classloading.jar", - "jboss-classloading-vfs.jar", - // Fixme aop - "jboss-aop.jar", - "jboss-aop-mc-int.jar", - "trove.jar", - }; - - /** The default server type. */ - public static final String DEFAULT_SERVER_TYPE = "org.jboss.bootstrap.microcontainer.ServerImpl"; - - /** - * Configuration properties. - */ - protected Properties props; - - /** - * The URL where libraries are read from. - */ - protected URL libraryURL; - - /** - * A list of extra URLs to add to the classpath when loading - * the server. - */ - protected List
Do not remove this method without running the WebIntegrationTestSuite - * @return the urls - */ - public URL[] getAllURLs() - { - return super.getURLs(); - } - - /** - * Return an empty URL array to force the RMI marshalling subsystem to - * use the java.server.codebase property as the annotated codebase. - * - *
Do not remove this method without discussing it on the dev list.
- *
- * @return Empty URL[]
- */
- public URL[] getURLs()
- {
- return EMPTY_URL_ARRAY;
- }
-}
Index: main/src/main/org/jboss/Main.java
===================================================================
--- main/src/main/org/jboss/Main.java (revision 86401)
+++ main/src/main/org/jboss/Main.java (working copy)
@@ -33,10 +33,10 @@
import java.util.List;
import java.util.Properties;
+import org.jboss.bootstrap.ServerLoader;
import org.jboss.bootstrap.spi.Server;
import org.jboss.bootstrap.spi.ServerConfig;
import org.jboss.bootstrap.spi.util.ServerConfigUtil;
-import org.jboss.system.server.ServerLoader;
/**
* Provides a command line interface to start the JBoss server.
Index: main/build.xml
===================================================================
--- main/build.xml (revision 86401)
+++ main/build.xml (working copy)
@@ -174,6 +174,8 @@