[jboss-cvs] JBossAS SVN: r71001 - in trunk: bootstrap/src/main/org/jboss/bootstrap/spi and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Mar 19 10:42:54 EDT 2008


Author: adrian at jboss.org
Date: 2008-03-19 10:42:54 -0400 (Wed, 19 Mar 2008)
New Revision: 71001

Modified:
   trunk/bootstrap/src/main/org/jboss/bootstrap/AbstractServerImpl.java
   trunk/bootstrap/src/main/org/jboss/bootstrap/spi/Bootstrap.java
   trunk/system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java
Log:
[JBAS-5327] [JBAS-5328] - Fix bootstrap shutdown bug and integrate signalling prepareShutdown to the deployers

Modified: trunk/bootstrap/src/main/org/jboss/bootstrap/AbstractServerImpl.java
===================================================================
--- trunk/bootstrap/src/main/org/jboss/bootstrap/AbstractServerImpl.java	2008-03-19 14:14:58 UTC (rev 71000)
+++ trunk/bootstrap/src/main/org/jboss/bootstrap/AbstractServerImpl.java	2008-03-19 14:42:54 UTC (rev 71001)
@@ -405,8 +405,8 @@
             for (Bootstrap bootstrap : bootstraps)
             {
                Thread.currentThread().setContextClassLoader(bootstrap.getClass().getClassLoader());
+               startedBootstraps.add(0, bootstrap);
                bootstrap.start(this);
-               startedBootstraps.add(0, bootstrap);
             }
          }
          finally
@@ -496,6 +496,9 @@
       ClassLoader cl = Thread.currentThread().getContextClassLoader();
       try
       {
+         for (Bootstrap bootstrap : startedBootstraps)
+            bootstrap.prepareShutdown(this);
+         
          // Do the bootstraps in reverse order
          for (Bootstrap bootstrap : startedBootstraps)
          {

Modified: trunk/bootstrap/src/main/org/jboss/bootstrap/spi/Bootstrap.java
===================================================================
--- trunk/bootstrap/src/main/org/jboss/bootstrap/spi/Bootstrap.java	2008-03-19 14:14:58 UTC (rev 71000)
+++ trunk/bootstrap/src/main/org/jboss/bootstrap/spi/Bootstrap.java	2008-03-19 14:42:54 UTC (rev 71001)
@@ -40,6 +40,13 @@
    void start(Server server) throws Exception;
    
    /**
+    * Invoked to say we are preparing shutdown
+    * 
+    * @param server the server
+    */
+   void prepareShutdown(Server server);
+   
+   /**
     * Invoked at shutdown
     * 
     * @param server the server instance

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java	2008-03-19 14:14:58 UTC (rev 71000)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java	2008-03-19 14:42:54 UTC (rev 71001)
@@ -22,6 +22,7 @@
 package org.jboss.system.server.profileservice;
 
 import java.util.Collection;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.jboss.bootstrap.spi.Bootstrap;
 import org.jboss.dependency.spi.ControllerContext;
@@ -65,6 +66,9 @@
    /** The kernel */
    protected Kernel kernel;
    
+   /** Whether we are shutdown */
+   private AtomicBoolean shutdown = new AtomicBoolean(false);
+   
    /**
     * Create a new ProfileServiceBootstrap.
     */
@@ -114,6 +118,8 @@
 
    public void start(Server server) throws Exception
    {
+      shutdown.set(false);
+      
       KernelController controller = kernel.getController();
       
       // Get the beans TODO injection!
@@ -144,6 +150,13 @@
          profile.enableModifiedDeploymentChecks(true);
    }
 
+   public void prepareShutdown(Server server)
+   {
+      shutdown.set(true);
+      if (mainDeployer != null)
+         mainDeployer.prepareShutdown();
+   }
+
    public void shutdown(Server server)
    {
       unloadProfile(profileName);




More information about the jboss-cvs-commits mailing list