[Jboss-cvs] JBossAS SVN: r55504 - in branches/MC_VDF_WORK: server/src/etc/conf/default system/src/main/org/jboss/deployers/plugins

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Aug 10 17:17:55 EDT 2006


Author: scott.stark at jboss.org
Date: 2006-08-10 17:17:50 -0400 (Thu, 10 Aug 2006)
New Revision: 55504

Modified:
   branches/MC_VDF_WORK/server/src/etc/conf/default/deployer-beans.xml
   branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/plugins/AbstractAspectDeployer.java
   branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/plugins/MainDeployerImpl.java
Log:
Instead of having deployers lazily register with the MainDeployer and needing a barrier bean to ensure beans needing deployers can start, inject the deployers into the MainDeployer so that it can act as the supplies=Deployers barrier.

Modified: branches/MC_VDF_WORK/server/src/etc/conf/default/deployer-beans.xml
===================================================================
--- branches/MC_VDF_WORK/server/src/etc/conf/default/deployer-beans.xml	2006-08-10 21:07:05 UTC (rev 55503)
+++ branches/MC_VDF_WORK/server/src/etc/conf/default/deployer-beans.xml	2006-08-10 21:17:50 UTC (rev 55504)
@@ -19,6 +19,14 @@
    <!-- The MainDeployer -->
    <bean name="MainDeployer" class="org.jboss.deployers.plugins.MainDeployerImpl">
       <property name="VFSFactory"><inject bean="VFSFactory"/></property>
+      <property name="deployers">
+         <array class="[Lorg.jboss.deployers.spi.AspectDeployer;" elementClass="org.jboss.deployers.spi.AspectDeployer">
+            <inject bean="ClassLoadingDeployer"/>
+            <inject bean="BeanDeployer"/>
+            <inject bean="SARDeployer"/>
+         </array>
+      </property>
+      <supply>Deployers</supply>
    </bean>
    <!-- The factory for VFS instances -->
    <bean name="VFSFactory" class="org.jboss.vfs.file.DefaultVFSFactory">
@@ -27,10 +35,8 @@
    <!-- Deployers. Declaration order defines the deployer chain order
    -->
    <bean name="ClassLoadingDeployer" class="org.jboss.deployers.plugins.classloading.ClassLoadingDeployer">
-      <property name="mainDeployer"><inject bean="MainDeployer"/></property>
    </bean>
    <bean name="BeanDeployer" class="org.jboss.deployers.plugins.bean.BeanDeployer">
-      <property name="mainDeployer"><inject bean="MainDeployer"/></property>
    </bean>
 
    <!-- Load the jboss jmx classes -->
@@ -47,7 +53,7 @@
 	         	<value>jboss-system-jmx.jar</value>
          	</array>
          	</parameter>
-         <parameter><inject bean="MainDeployer" property="VFSFactory"/></parameter>
+         <parameter><inject bean="VFSFactory"/></parameter>
       </constructor>
    </bean>
    <bean name="SARDeployer" class="org.jboss.deployment.SARDeployer">
@@ -55,7 +61,6 @@
       <property name="useNamespaceAwareParser">true</property>
       <property name="server"><inject bean="JMXKernel" property="mbeanServer" /></property>
       <property name="serviceController"><inject bean="JMXKernel" property="serviceController" /></property>
-      <property name="mainDeployer"><inject bean="MainDeployer"/></property>
    </bean>
 	<!-- A bean that setups a jboss-4.0.x type of jmx kernel to support the
 		the legacy mbean deployments handled by the SARDeployer
@@ -64,19 +69,6 @@
       <classloader><inject bean="JMXClassLoader"/></classloader>
       <property name="serverImpl"><inject bean="org.jboss.system.server.Server"/></property>
    </bean>
-   <!-- A barrier class used to allow the VFSDeploymentScanner to wait until
-   all deployers have started using <demands>Deployers</demands>
-   -->
-   <bean name="DeployersBarrier" class="org.jboss.deployers.plugins.DeployersBarrier">
-      <property name="deployers">
-         <array class="[Lorg.jboss.deployers.spi.AspectDeployer;" elementClass="org.jboss.deployers.spi.AspectDeployer">
-            <inject bean="ClassLoadingDeployer"/>
-            <inject bean="BeanDeployer"/>
-            <inject bean="SARDeployer"/>
-         </array>
-      </property>
-      <supply>Deployers</supply>
-   </bean>
 
    <!-- Hot deployment service that directly uses the MainDeployer -->
    <bean name="VFSDeploymentScanner" class="org.jboss.deployers.plugins.scanner.VFSDeploymentScannerImpl">

Modified: branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/plugins/AbstractAspectDeployer.java
===================================================================
--- branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/plugins/AbstractAspectDeployer.java	2006-08-10 21:07:05 UTC (rev 55503)
+++ branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/plugins/AbstractAspectDeployer.java	2006-08-10 21:17:50 UTC (rev 55504)
@@ -26,7 +26,6 @@
 import org.jboss.deployers.spi.AspectDeployer;
 import org.jboss.deployers.spi.DeploymentContext;
 import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.MainDeployer;
 import org.jboss.kernel.plugins.event.AbstractEvent;
 import org.jboss.kernel.spi.dependency.KernelControllerContext;
 import org.jboss.kernel.spi.dependency.KernelControllerContextAware;
@@ -56,9 +55,6 @@
    /** A qualifying name for this deployer */
    protected String deployerName;
    
-   /** The MainDeployer to which we are registered */
-   protected MainDeployer mainDeployer;
-   
    /** The suffixes of interest to this deployer */
    protected String[] suffixes = NULL_SUFFIXES;
    
@@ -118,27 +114,6 @@
    }
 
    /**
-    * Sets the MainDeployer to which the AspectDeployer is registered
-    * 
-    * @param mainDeployer
-    */
-   public void setMainDeployer(MainDeployer mainDeployer)
-   {
-      this.mainDeployer = mainDeployer;
-      log.debug("MainDeployer set to:"+mainDeployer);
-   }
-   
-   /**
-    * Gets the MainDeployer to which the AspectDeployer is registerd
-    * 
-    * @return the mainDeployer or null
-    */
-   public MainDeployer getMainDeployer()
-   {
-      return mainDeployer;
-   }
-   
-   /**
     * Sets an array of enhanced suffixes of interest to this deployer
     * 
     * @param enhancedSuffixes array of enhanced suffix strings
@@ -242,23 +217,17 @@
    public void create() throws Exception {}
 
    /**
-    * The kernel start lifecycle callback. This registers the deployer with
-    * the mainDeployer and should be called by subclasses after they are
-    * started.
+    * Noop
     */
    public void start() throws Exception
    {
-      mainDeployer.register(this);
    }
    
    /**
-    * The kernel stop lifecycle callback. This unregisters the deployer with
-    * the mainDeployer and should be called by subclasses before they are
-    * stopped.
+    * Noop
     */
    public void stop()
    {
-      mainDeployer.unregister(this);
    }
    
    /**

Modified: branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/plugins/MainDeployerImpl.java
===================================================================
--- branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/plugins/MainDeployerImpl.java	2006-08-10 21:07:05 UTC (rev 55503)
+++ branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/plugins/MainDeployerImpl.java	2006-08-10 21:17:50 UTC (rev 55504)
@@ -25,6 +25,7 @@
 import java.net.URI;
 import java.net.URL;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
@@ -99,6 +100,18 @@
       this.factory = factory;
    }
 
+   public AspectDeployer[] getDeployers()
+   {
+      AspectDeployer[] tmp = new AspectDeployer[deployers.size()];
+      deployers.toArray(tmp);
+      return tmp;
+   }
+   public void setDeployers(AspectDeployer[] deployers)
+   {
+      this.deployers.clear();
+      this.deployers.addAll(Arrays.asList(deployers));
+   }
+
    /**
     * @return the DeploymentGraphBuilder plugin
     */




More information about the jboss-cvs-commits mailing list