[jboss-cvs] JBossAS SVN: r106080 - in trunk/weld-int: deployer/src/main/java/org/jboss/weld/integration/deployer and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jun 16 05:44:41 EDT 2010


Author: alesj
Date: 2010-06-16 05:44:40 -0400 (Wed, 16 Jun 2010)
New Revision: 106080

Modified:
   trunk/weld-int/assembly/src/main/assembly/resources/META-INF/weld-deployers-jboss-beans.xml
   trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/DeployersUtils.java
   trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/env/AbstractBootstrapInfoDeployer.java
   trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/env/WebContainerDependencyDeployer.java
Log:
[JBAS-8102]; hide the bootstrap bean lookup details.

Modified: trunk/weld-int/assembly/src/main/assembly/resources/META-INF/weld-deployers-jboss-beans.xml
===================================================================
--- trunk/weld-int/assembly/src/main/assembly/resources/META-INF/weld-deployers-jboss-beans.xml	2010-06-16 05:34:29 UTC (rev 106079)
+++ trunk/weld-int/assembly/src/main/assembly/resources/META-INF/weld-deployers-jboss-beans.xml	2010-06-16 09:44:40 UTC (rev 106080)
@@ -29,13 +29,11 @@
   <!-- Responsible for booting Weld -->
   <bean name="WeldBootstrapDeployer" class="org.jboss.weld.integration.deployer.env.WeldBootstrapDeployer"/>
   
-  <!-- Responsible for pushing the JSF faces-config.xml onto the application classpath
--->
+  <!-- Responsible for pushing the JSF faces-config.xml onto the application classpath -->
   <bean name="WeldFacesIntegrationDeployer" class="org.jboss.weld.integration.deployer.cl.WeldFacesIntegrationDeployer"/>
   
-  <!-- Responsible for pushing the webtier integration jar onto the application classpath
--->
-  <bean name="WeldWenTierIntegrationDeployer" class="org.jboss.weld.integration.deployer.cl.WeldWebTierIntegrationDeployer"/>
+  <!-- Responsible for pushing the webtier integration jar onto the application classpath -->
+  <bean name="WeldWebTierIntegrationDeployer" class="org.jboss.weld.integration.deployer.cl.WeldWebTierIntegrationDeployer"/>
   
   <!-- Responsible for pushing Weld onto the application classpath -->
   <bean name="WeldCoreIntegrationDeployer" class="org.jboss.weld.integration.deployer.cl.WeldCoreIntegrationDeployer"/>
@@ -80,8 +78,6 @@
   </bean>
 
   <!-- Adds plugin to BeanMetaDataDeployer that installs WeldKernelControllerContexts -->
-  <!-- bean name="WeldBeanMetaDataDeployerPlugin" class="org.jboss.weld.integration.deployer.mc.WeldBeanMetaDataDeployerPlugin"/ -->
-  
+  <!-- bean name="WeldBeanMetaDataDeployerPlugin" class="org.jboss.weld.integration.deployer.mc.WeldBeanMetaDataDeployerPlugin"/ -->  
 
-
 </deployment>

Modified: trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/DeployersUtils.java
===================================================================
--- trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/DeployersUtils.java	2010-06-16 05:34:29 UTC (rev 106079)
+++ trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/DeployersUtils.java	2010-06-16 09:44:40 UTC (rev 106080)
@@ -62,30 +62,46 @@
    }
 
    /**
-    * Get the name of the bootstrap bean deployer attachment
-    * @param unit The deployment unit
+    * Get the name of the bootstrap bean deployer attachment.
+    *
+    * @param unit the deployment unit
     * @return the deployer attachment name of the bootstrap bean
     */
    public static String getBootstrapBeanAttachmentName(DeploymentUnit unit)
    {
-      if (unit == null)
-         throw new IllegalArgumentException("Null deployment unit");
-
       return getBootstrapBeanName(unit) + "_" + BeanMetaData.class.getSimpleName();
    }
 
    /**
-    * Get the name of the weld deployment bean
+    * Is the bootstrap bean present.
+    *
+    * @param unit the deployment unit
+    * @return true if there is bootstrap bean in attachments, false otherwise
+    */
+   public static boolean isBootstrapBeanPresent(DeploymentUnit unit)
+   {
+      String attachmentName = getBootstrapBeanAttachmentName(unit);
+      DeploymentUnit top = unit.getTopLevel();
+      return top.isAttachmentPresent(attachmentName);
+   }
+
+   /**
+    * Get the name of the weld deployment bean.
+    *
     * @param unit The deployment unit
     * @return the weld deployment bean name
     */
    public static String getDeploymentBeanName(DeploymentUnit unit)
    {
+      if (unit == null)
+         throw new IllegalArgumentException("Null deployment unit");
+
       return unit.getName() + "_JBossDeployment";
    }
 
    /**
-    * Get the name of the weld deployment deployers attachment
+    * Get the name of the weld deployment deployers attachment.
+    *
     * @param unit The deployment unit
     * @return the deployer attachment name of the weld deployment
     */

Modified: trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/env/AbstractBootstrapInfoDeployer.java
===================================================================
--- trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/env/AbstractBootstrapInfoDeployer.java	2010-06-16 05:34:29 UTC (rev 106079)
+++ trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/env/AbstractBootstrapInfoDeployer.java	2010-06-16 09:44:40 UTC (rev 106080)
@@ -55,7 +55,7 @@
       {
          deployInternal(unit, info);
       }
-      else if (info == null && DeployersUtils.checkForWeldFiles(unit))
+      else if (DeployersUtils.checkForWeldFiles(unit))
       {
          info = new BootstrapInfo();
          unit.addAttachment(BootstrapInfo.class, info);
@@ -74,7 +74,6 @@
 
    protected void undeployInternal(DeploymentUnit unit, BootstrapInfo info)
    {
-
    }
 
    /**

Modified: trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/env/WebContainerDependencyDeployer.java
===================================================================
--- trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/env/WebContainerDependencyDeployer.java	2010-06-16 05:34:29 UTC (rev 106079)
+++ trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/env/WebContainerDependencyDeployer.java	2010-06-16 09:44:40 UTC (rev 106080)
@@ -14,6 +14,7 @@
  * (if this is a CDI-enabled deployment)
  *
  * @author Marius Bogoevici
+ * @author Ales Justin
  */
 public class WebContainerDependencyDeployer extends AbstractSimpleRealDeployer<JBossWebMetaData>
 {
@@ -26,8 +27,7 @@
    @Override
    public void deploy(DeploymentUnit unit, JBossWebMetaData deployment) throws DeploymentException
    {
-      String bootstrapBeanName = DeployersUtils.getBootstrapBeanAttachmentName(unit.getTopLevel());
-      if (unit.getTopLevel().getAttachment(bootstrapBeanName) != null)
+      if (DeployersUtils.isBootstrapBeanPresent(unit))
       {
          List<String> depends = deployment.getDepends();
          if (depends == null)



More information about the jboss-cvs-commits mailing list