[jboss-cvs] JBossAS SVN: r90977 - in projects/bootstrap/trunk: impl-as/src/main/java/org/jboss/bootstrap/impl/as/server and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jul 8 23:10:17 EDT 2009


Author: ALRubinger
Date: 2009-07-08 23:10:16 -0400 (Wed, 08 Jul 2009)
New Revision: 90977

Modified:
   projects/bootstrap/trunk/impl-as/pom.xml
   projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/server/JBossASServerImpl.java
   projects/bootstrap/trunk/impl-base/src/main/java/org/jboss/bootstrap/impl/base/server/AbstractServer.java
   projects/bootstrap/trunk/impl-mc/pom.xml
   projects/bootstrap/trunk/impl-mc/src/main/java/org/jboss/bootstrap/impl/mc/server/AbstractMCServerBase.java
Log:
[JBBOOT-96]

Modified: projects/bootstrap/trunk/impl-as/pom.xml
===================================================================
--- projects/bootstrap/trunk/impl-as/pom.xml	2009-07-09 02:14:51 UTC (rev 90976)
+++ projects/bootstrap/trunk/impl-as/pom.xml	2009-07-09 03:10:16 UTC (rev 90977)
@@ -25,7 +25,7 @@
   <properties>
 
     <!-- Versions -->
-    <version.org.jboss.bootstrap_jboss.bootstrap.impl.mc>2.0.0-alpha-1</version.org.jboss.bootstrap_jboss.bootstrap.impl.mc>
+    <version.org.jboss.bootstrap_jboss.bootstrap.impl.mc>2.0.0-SNAPSHOT</version.org.jboss.bootstrap_jboss.bootstrap.impl.mc>
     <version.org.jboss.bootstrap_jboss.bootstrap.spi.as>2.0.0-SNAPSHOT</version.org.jboss.bootstrap_jboss.bootstrap.spi.as>
     <!-- REMOVE: JBBOOT-68 -->
     <version.org.jboss_jboss.vfs>2.2.0.M4</version.org.jboss_jboss.vfs>

Modified: projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/server/JBossASServerImpl.java
===================================================================
--- projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/server/JBossASServerImpl.java	2009-07-09 02:14:51 UTC (rev 90976)
+++ projects/bootstrap/trunk/impl-as/src/main/java/org/jboss/bootstrap/impl/as/server/JBossASServerImpl.java	2009-07-09 03:10:16 UTC (rev 90977)
@@ -91,12 +91,12 @@
     * Character denoting that we're referencing an environment variable or some property
     */
    private static final char CHAR_ENV_VAR = '$';
-   
+
    /**
     * Newline character
     */
    private static final char CHAR_NEWLINE = '\n';
-   
+
    /**
     * Tab character
     */
@@ -289,15 +289,15 @@
       return state.equals(LifecycleState.STARTED);
    }
 
-   /* (non-Javadoc)
-    * @see org.jboss.bootstrap.impl.mc.server.AbstractMCServerBase#initialize()
+   /*
+    * (non-Javadoc)
+    * @see org.jboss.bootstrap.impl.base.server.AbstractServer#initialize()
     */
    @Override
-   public synchronized void initialize() throws IllegalStateException, InvalidConfigurationException,
-         LifecycleEventException
+   protected void doInitialize() throws IllegalStateException, InvalidConfigurationException, LifecycleEventException
    {
       // Call Super
-      super.initialize();
+      super.doInitialize();
 
       // JBBOOT-68
       //TODO Remove once VFS is init'd from something else

Modified: projects/bootstrap/trunk/impl-base/src/main/java/org/jboss/bootstrap/impl/base/server/AbstractServer.java
===================================================================
--- projects/bootstrap/trunk/impl-base/src/main/java/org/jboss/bootstrap/impl/base/server/AbstractServer.java	2009-07-09 02:14:51 UTC (rev 90976)
+++ projects/bootstrap/trunk/impl-base/src/main/java/org/jboss/bootstrap/impl/base/server/AbstractServer.java	2009-07-09 03:10:16 UTC (rev 90977)
@@ -508,13 +508,20 @@
     * @see org.jboss.bootstrap.spi.server.Server#initialize()
     */
    // Synchronized for atomicity
-   public synchronized void initialize() throws IllegalStateException, InvalidConfigurationException,
+   public final synchronized void initialize() throws IllegalStateException, InvalidConfigurationException,
          LifecycleEventException
    {
       /*
        * Precondition checks
        */
 
+      // Config must be in place
+      final T config = this.getConfiguration();
+      if (config == null)
+      {
+         throw new IllegalStateException("Configuration must be supplied before server is initialized");
+      }
+
       // State must be instanciated
       final LifecycleState state = this.getState();
       if (!state.equals(LifecycleState.INSTANCIATED))
@@ -522,6 +529,34 @@
          throw new IllegalStateException("Cannot initialize an already initialized server, state is: " + state);
       }
 
+      // Set state to pre-init to fire lifecycle callbacks
+      this.setState(LifecycleState.PRE_INIT);
+
+      // Log
+      log.debug("Initializing server: " + this);
+
+      // Do the actual initialization logic
+      this.doInitialize();
+
+      // Freeze config
+      config.freeze();
+
+      // Set state (firing lifecycle callbacks along the way)
+      this.setState(LifecycleState.INITIALIZED);
+      this.setState(LifecycleState.IDLE);
+   }
+
+   /**
+    * Implementation-specific initialization logic; invoked by
+    * {@link AbstractServer#initialize()}
+    * 
+    * @throws IllegalStateException
+    * @throws InvalidConfigurationException
+    * @throws LifecycleEventException
+    */
+   protected void doInitialize() throws IllegalStateException, InvalidConfigurationException, LifecycleEventException
+   {
+
       // Config must be in place
       final T config = this.getConfiguration();
       if (config == null)
@@ -529,12 +564,6 @@
          throw new IllegalStateException("Configuration must be supplied before server is initialized");
       }
 
-      // Log
-      log.debug("Initializing server: " + this);
-
-      // Set state to pre-init to fire lifecycle callbacks
-      this.setState(LifecycleState.PRE_INIT);
-
       // If there's a configuration initializer, use it
       final ConfigurationInitializer<T> configInitializer = this.getConfigInitializer();
       if (configInitializer != null)
@@ -572,13 +601,6 @@
       {
          log.debug("No initializer defined, skipping initialization of " + this);
       }
-
-      // Freeze config
-      config.freeze();
-
-      // Set state (firing lifecycle callbacks along the way)
-      this.setState(LifecycleState.INITIALIZED);
-      this.setState(LifecycleState.IDLE);
    }
 
    /* (non-Javadoc)

Modified: projects/bootstrap/trunk/impl-mc/pom.xml
===================================================================
--- projects/bootstrap/trunk/impl-mc/pom.xml	2009-07-09 02:14:51 UTC (rev 90976)
+++ projects/bootstrap/trunk/impl-mc/pom.xml	2009-07-09 03:10:16 UTC (rev 90977)
@@ -25,7 +25,7 @@
   <!-- Properties -->
   <properties>
 
-    <version.org.jboss.bootstrap_jboss.bootstrap.impl.base>2.0.0-alpha-1</version.org.jboss.bootstrap_jboss.bootstrap.impl.base>
+    <version.org.jboss.bootstrap_jboss.bootstrap.impl.base>2.0.0-SNAPSHOT</version.org.jboss.bootstrap_jboss.bootstrap.impl.base>
     <version.org.jboss.bootstrap_jboss.bootstrap.spi.mc>2.0.0-alpha-1</version.org.jboss.bootstrap_jboss.bootstrap.spi.mc>
     <version.org.jboss.man_jboss.managed>2.1.0.SP1</version.org.jboss.man_jboss.managed>
 

Modified: projects/bootstrap/trunk/impl-mc/src/main/java/org/jboss/bootstrap/impl/mc/server/AbstractMCServerBase.java
===================================================================
--- projects/bootstrap/trunk/impl-mc/src/main/java/org/jboss/bootstrap/impl/mc/server/AbstractMCServerBase.java	2009-07-09 02:14:51 UTC (rev 90976)
+++ projects/bootstrap/trunk/impl-mc/src/main/java/org/jboss/bootstrap/impl/mc/server/AbstractMCServerBase.java	2009-07-09 03:10:16 UTC (rev 90977)
@@ -195,12 +195,12 @@
 
    }
 
-   /* (non-Javadoc)
+   /*
+    * (non-Javadoc)
     * @see org.jboss.bootstrap.impl.base.server.AbstractServer#initialize()
     */
    @Override
-   public synchronized void initialize() throws IllegalStateException, InvalidConfigurationException,
-         LifecycleEventException
+   protected void doInitialize() throws IllegalStateException, InvalidConfigurationException, LifecycleEventException
    {
       /*
        * We need to start the bootstrap here so we can set the kernel
@@ -209,7 +209,7 @@
       this.initializeBootstrap();
 
       // Call Super implementation
-      super.initialize();
+      super.doInitialize();
    }
 
    /* (non-Javadoc)




More information about the jboss-cvs-commits mailing list