[Jboss-cvs] JBossAS SVN: r55024 - trunk/system/src/main/org/jboss

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Aug 2 02:36:02 EDT 2006


Author: scott.stark at jboss.org
Date: 2006-08-02 02:36:00 -0400 (Wed, 02 Aug 2006)
New Revision: 55024

Modified:
   trunk/system/src/main/org/jboss/Main.java
Log:
Expose the booted server instance and shutdown.

Modified: trunk/system/src/main/org/jboss/Main.java
===================================================================
--- trunk/system/src/main/org/jboss/Main.java	2006-08-02 06:33:02 UTC (rev 55023)
+++ trunk/system/src/main/org/jboss/Main.java	2006-08-02 06:36:00 UTC (rev 55024)
@@ -85,6 +85,8 @@
     * properties for defaults.
     */
    private Properties props = new Properties(System.getProperties());
+   /** The booted server instance */
+   private Server server;
 
    /**
     * Explicit constructor.
@@ -95,6 +97,15 @@
    }
 
    /**
+    * Access the booted server.
+    * @return the Server instance.
+    */
+   public Server getServer()
+   {
+      return server;
+   }
+
+   /**
     * Boot up JBoss.
     *
     * @param args   The command line arguments.
@@ -192,7 +203,7 @@
 
       // Load the server
       ClassLoader parentCL = Thread.currentThread().getContextClassLoader();
-      Server server = loader.load(parentCL);
+      server = loader.load(parentCL);
 
       // Initialize the server
       server.init(props);
@@ -201,6 +212,15 @@
       server.start();
    }
 
+   /**
+    * Shutdown the booted Server instance.
+    *
+    */
+   public void shutdown()
+   {
+      server.shutdown();
+   }
+
    private URL makeURL(String urlspec) throws MalformedURLException
    {
       urlspec = urlspec.trim();




More information about the jboss-cvs-commits mailing list