[jboss-cvs] JBossAS SVN: r86046 - in projects/webbeans-ri-int/trunk/microcontainer/src: main/java/org/jboss/webbeans/integration/microcontainer/deployer/env and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Mar 18 10:06:15 EDT 2009


Author: alesj
Date: 2009-03-18 10:06:15 -0400 (Wed, 18 Mar 2009)
New Revision: 86046

Modified:
   projects/webbeans-ri-int/trunk/microcontainer/src/main/java/org/jboss/webbeans/integration/microcontainer/deployer/DeployersUtils.java
   projects/webbeans-ri-int/trunk/microcontainer/src/main/java/org/jboss/webbeans/integration/microcontainer/deployer/env/WebBeansBootstrapDeployer.java
   projects/webbeans-ri-int/trunk/microcontainer/src/test/java/org/jboss/test/webbeans/deployers/support/MockBootDeployer.java
   projects/webbeans-ri-int/trunk/microcontainer/src/test/java/org/jboss/test/webbeans/deployers/test/BootDeployerTestCase.java
Log:
Expose bootstrap bean name.

Modified: projects/webbeans-ri-int/trunk/microcontainer/src/main/java/org/jboss/webbeans/integration/microcontainer/deployer/DeployersUtils.java
===================================================================
--- projects/webbeans-ri-int/trunk/microcontainer/src/main/java/org/jboss/webbeans/integration/microcontainer/deployer/DeployersUtils.java	2009-03-18 14:05:03 UTC (rev 86045)
+++ projects/webbeans-ri-int/trunk/microcontainer/src/main/java/org/jboss/webbeans/integration/microcontainer/deployer/DeployersUtils.java	2009-03-18 14:06:15 UTC (rev 86046)
@@ -41,7 +41,21 @@
    public static final String WEB_BEANS_CLASSPATH = "WEB_BEANS_CLASSPATH";
    public static final String WEB_BEANS_DEPLOYMENT_FLAG = "WEB_BEANS_DEPLOYMENT_FLAG";
 
+   public static final String WEB_BEANS_BOOTSTRAP_BEAN = "_WebBeansBootstrap";
+
    /**
+    * Get bootstrap bean name.
+    *
+    * @param unit the deployment unit
+    * @return webbeans bootstrap bean name
+    */
+   public static String getBootstrapBeanName(DeploymentUnit unit)
+   {
+      DeploymentUnit top = unit.getTopLevel();
+      return top.getName() + WEB_BEANS_BOOTSTRAP_BEAN;
+   }
+
+   /**
     * Check deployment hierarchy for beans.xml files.
     * It checks the 'cached' flag.
     *

Modified: projects/webbeans-ri-int/trunk/microcontainer/src/main/java/org/jboss/webbeans/integration/microcontainer/deployer/env/WebBeansBootstrapDeployer.java
===================================================================
--- projects/webbeans-ri-int/trunk/microcontainer/src/main/java/org/jboss/webbeans/integration/microcontainer/deployer/env/WebBeansBootstrapDeployer.java	2009-03-18 14:05:03 UTC (rev 86045)
+++ projects/webbeans-ri-int/trunk/microcontainer/src/main/java/org/jboss/webbeans/integration/microcontainer/deployer/env/WebBeansBootstrapDeployer.java	2009-03-18 14:06:15 UTC (rev 86046)
@@ -30,6 +30,7 @@
 import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.webbeans.context.api.BeanStore;
 import org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore;
+import org.jboss.webbeans.integration.microcontainer.deployer.DeployersUtils;
 
 /**
  * Deploy WebBeans boostrap service.
@@ -49,13 +50,12 @@
    public void deploy(DeploymentUnit unit, WebBeanDiscoveryEnvironment env) throws DeploymentException
    {
       String unitName = unit.getName();
-
       String envName = unitName + "_JBossWebBeanDiscovery";
       BeanMetaDataBuilder envWrapper = BeanMetaDataBuilder.createBuilder(envName, "org.jboss.webbeans.integration.jbossas.bootstrap.JBossWebBeanDiscovery");
       envWrapper.addConstructorParameter(WebBeanDiscoveryEnvironment.class.getName(), env);
       unit.addAttachment(envName + "_" + BeanMetaData.class.getSimpleName(), envWrapper.getBeanMetaData());
 
-      String bootstrapName = unitName + "_WebBeansBootstrap";
+      String bootstrapName = DeployersUtils.getBootstrapBeanName(unit);
       BeanMetaDataBuilder bootstrap = BeanMetaDataBuilder.createBuilder(bootstrapName, "org.jboss.webbeans.bootstrap.WebBeansBootstrap");
       bootstrap.addPropertyMetaData("webBeanDiscovery", bootstrap.createInject(envName));
       bootstrap.addPropertyMetaData("ejbServices", createEjbConnector("JBossEjbServices", "org.jboss.webbeans.integration.ejb.JBossEjbServices", unit));

Modified: projects/webbeans-ri-int/trunk/microcontainer/src/test/java/org/jboss/test/webbeans/deployers/support/MockBootDeployer.java
===================================================================
--- projects/webbeans-ri-int/trunk/microcontainer/src/test/java/org/jboss/test/webbeans/deployers/support/MockBootDeployer.java	2009-03-18 14:05:03 UTC (rev 86045)
+++ projects/webbeans-ri-int/trunk/microcontainer/src/test/java/org/jboss/test/webbeans/deployers/support/MockBootDeployer.java	2009-03-18 14:06:15 UTC (rev 86046)
@@ -31,6 +31,7 @@
 import org.jboss.webbeans.context.api.BeanStore;
 import org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore;
 import org.jboss.webbeans.integration.microcontainer.deployer.env.WebBeanDiscoveryEnvironment;
+import org.jboss.webbeans.integration.microcontainer.deployer.DeployersUtils;
 
 /**
  * Mock wb boot deployer.
@@ -50,13 +51,12 @@
    public void deploy(DeploymentUnit unit, WebBeanDiscoveryEnvironment env) throws DeploymentException
    {
       String unitName = unit.getName();
-
       String envName = unitName + "_JBossWebBeanDiscovery";
       BeanMetaDataBuilder envWrapper = BeanMetaDataBuilder.createBuilder(envName, "org.jboss.test.webbeans.deployers.support.WBDEWrapper");
       envWrapper.addConstructorParameter(WebBeanDiscoveryEnvironment.class.getName(), env);
       unit.addAttachment(envName + "_" + BeanMetaData.class.getSimpleName(), envWrapper.getBeanMetaData());
 
-      String bootstrapName = unitName + "_WebBeansBootstrap";
+      String bootstrapName = DeployersUtils.getBootstrapBeanName(unit);
       BeanMetaDataBuilder bootstrap = BeanMetaDataBuilder.createBuilder(bootstrapName, "org.jboss.test.webbeans.deployers.support.MockWBBootstrap");
       bootstrap.addPropertyMetaData("webBeanDiscovery", bootstrap.createInject(envName));
       bootstrap.addPropertyMetaData("ejbServices", createEjbConnector("JBossEjbServices", "org.jboss.test.webbeans.deployers.support.MockEjbServices", unit));

Modified: projects/webbeans-ri-int/trunk/microcontainer/src/test/java/org/jboss/test/webbeans/deployers/test/BootDeployerTestCase.java
===================================================================
--- projects/webbeans-ri-int/trunk/microcontainer/src/test/java/org/jboss/test/webbeans/deployers/test/BootDeployerTestCase.java	2009-03-18 14:05:03 UTC (rev 86045)
+++ projects/webbeans-ri-int/trunk/microcontainer/src/test/java/org/jboss/test/webbeans/deployers/test/BootDeployerTestCase.java	2009-03-18 14:06:15 UTC (rev 86046)
@@ -25,6 +25,7 @@
 import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.test.webbeans.deployers.support.CheckableBootstrap;
 import org.jboss.virtual.VirtualFile;
+import org.jboss.webbeans.integration.microcontainer.deployer.DeployersUtils;
 
 /**
  * Test boot deployer.
@@ -50,8 +51,7 @@
       DeploymentUnit earDU = assertDeploy(ear);
       try
       {
-         String earName = earDU.getName();
-         String bootName = earName + "_WebBeansBootstrap";
+         String bootName = DeployersUtils.getBootstrapBeanName(earDU);
          Object boot = getBean(bootName);
          bootstrap = assertInstanceOf(boot, CheckableBootstrap.class, false);
          assertTrue(bootstrap.isInit());




More information about the jboss-cvs-commits mailing list