[jboss-cvs] JBossAS SVN: r96258 - in projects/weld-int/trunk: assembly and 67 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Nov 11 09:42:05 EST 2009


Author: kabir.khan at jboss.com
Date: 2009-11-11 09:42:04 -0500 (Wed, 11 Nov 2009)
New Revision: 96258

Added:
   projects/weld-int/trunk/assembly/src/main/assembly/assembly-mc-int.xml
   projects/weld-int/trunk/deployer-mc-int/
   projects/weld-int/trunk/deployer-mc-int/pom.xml
   projects/weld-int/trunk/deployer-mc-int/src/
   projects/weld-int/trunk/deployer-mc-int/src/main/
   projects/weld-int/trunk/deployer-mc-int/src/main/java/
   projects/weld-int/trunk/deployer-mc-int/src/main/java/org/
   projects/weld-int/trunk/deployer-mc-int/src/main/java/org/jboss/
   projects/weld-int/trunk/deployer-mc-int/src/main/java/org/jboss/weld/
   projects/weld-int/trunk/deployer-mc-int/src/main/java/org/jboss/weld/integration/
   projects/weld-int/trunk/deployer-mc-int/src/main/java/org/jboss/weld/integration/App.java
   projects/weld-int/trunk/deployer-mc-int/src/main/java/org/jboss/weld/integration/deployer/
   projects/weld-int/trunk/deployer-mc-int/src/main/java/org/jboss/weld/integration/deployer/mc/
   projects/weld-int/trunk/deployer-mc-int/src/main/java/org/jboss/weld/integration/deployer/mc/BeanMetaDataPropertyHolder.java
   projects/weld-int/trunk/deployer-mc-int/src/main/java/org/jboss/weld/integration/deployer/mc/IntermediateWeldBootstrapBean.java
   projects/weld-int/trunk/deployer-mc-int/src/main/java/org/jboss/weld/integration/deployer/mc/WeldBeanMetaDataDeployerPlugin.java
   projects/weld-int/trunk/deployer-mc-int/src/main/resources/
   projects/weld-int/trunk/deployer-mc-int/src/main/resources/META-INF/
   projects/weld-int/trunk/deployer-mc-int/src/main/resources/META-INF/services/
   projects/weld-int/trunk/deployer-mc-int/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
   projects/weld-int/trunk/deployer-mc-int/src/test/
   projects/weld-int/trunk/deployer-mc-int/src/test/java/
   projects/weld-int/trunk/deployer-mc-int/src/test/java/org/
   projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/
   projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/
   projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/
   projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/
   projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/MockJBossJpaServices.java
   projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/MockPersistenceUnitDependencyResolver.java
   projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/deployer/
   projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/deployer/MockValidatorFactoryDeployer.java
   projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/
   projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/bidirectional/
   projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/bidirectional/end/
   projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/bidirectional/end/First.java
   projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/bidirectional/end/Last.java
   projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/bidirectional/middle/
   projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/bidirectional/middle/Middle.java
   projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/mc/
   projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/mc/fromweld/
   projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/mc/fromweld/McBeanWithInjectedWeldBean.java
   projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/mc/simple/
   projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/mc/simple/SimpleBean.java
   projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/weld/
   projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/weld/frommc/
   projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/weld/frommc/WeldBeanWithInjectedMcBean.java
   projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/weld/simple/
   projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/weld/simple/SimpleWebBean.java
   projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/test/
   projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/test/AbstractWeldTest.java
   projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/test/McIntegrationNoBootstrapBeanTestCase.java
   projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/test/McIntegrationTestCase.java
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/org/
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/org/jboss/
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/org/jboss/test/
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/org/jboss/test/deployers/
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/org/jboss/test/deployers/test/
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/org/jboss/test/deployers/test/McIntegrationNoBootstrapBeanTestCase.xml
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/org/jboss/test/deployers/test/McIntegrationTestCase.xml
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/META-INF/
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/META-INF/MANIFEST.MF
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/META-INF/application.properties
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/mc/
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/mc/end/
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/mc/end/META-INF/
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/mc/end/META-INF/MANIFEST.MF
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/mc/end/META-INF/end-beans.xml
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/mc/middle/
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/mc/middle/META-INF/
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/mc/middle/META-INF/MANIFEST.MF
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/mc/middle/META-INF/middle-beans.xml
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/mconly/
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/mconly/META-INF/
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/mconly/META-INF/MANIFEST.MF
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/mconly/META-INF/application.properties
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/weldandmc/
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/weldandmc/META-INF/
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/weldandmc/META-INF/MANIFEST.MF
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/weldandmc/META-INF/application.properties
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/weldonly/
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/weldonly/META-INF/
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/weldonly/META-INF/MANIFEST.MF
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/weldonly/META-INF/application.properties
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/mc/
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/mc/fromweld/
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/mc/fromweld/META-INF/
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/mc/fromweld/META-INF/MANIFEST.MF
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/mc/fromweld/META-INF/fromweld-beans.xml
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/mc/simple/
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/mc/simple/META-INF/
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/mc/simple/META-INF/MANIFEST.MF
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/mc/simple/META-INF/simple-beans.xml
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/weld/
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/weld/META-INF/
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/weld/META-INF/MANIFEST.MF
   projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/weld/META-INF/beans.xml
Modified:
   projects/weld-int/trunk/
   projects/weld-int/trunk/assembly/pom.xml
   projects/weld-int/trunk/assembly/src/main/assembly/resources/META-INF/weld-deployers-jboss-beans.xml
   projects/weld-int/trunk/deployer/pom.xml
   projects/weld-int/trunk/deployer/src/main/java/org/jboss/weld/integration/deployer/DeployersUtils.java
   projects/weld-int/trunk/deployer/src/main/java/org/jboss/weld/integration/deployer/env/AbstractDeploymentDeployer.java
   projects/weld-int/trunk/deployer/src/main/java/org/jboss/weld/integration/deployer/env/WeldBootstrapDeployer.java
   projects/weld-int/trunk/deployer/src/test/java/org/jboss/test/deployers/support/MockEjbServices.java
   projects/weld-int/trunk/pom.xml
Log:
[WELDINT-29] Add deployers for injection between weld and mc. This is currently only enabled if run with -Pmc-int, since the deployer-mc-int project relies on snapshots of deployers and kernle


Property changes on: projects/weld-int/trunk
___________________________________________________________________
Name: svn:ignore
   + target
.classpath
.project
.settings


Modified: projects/weld-int/trunk/assembly/pom.xml
===================================================================
--- projects/weld-int/trunk/assembly/pom.xml	2009-11-11 14:11:52 UTC (rev 96257)
+++ projects/weld-int/trunk/assembly/pom.xml	2009-11-11 14:42:04 UTC (rev 96258)
@@ -27,7 +27,7 @@
    		</snapshots>
    	</repository>
    </repositories>
-   
+
    <build>
       <plugins>
          <plugin>
@@ -65,6 +65,12 @@
       <artifactId>weld-jboss-int-deployer</artifactId>
       <optional>true</optional>
     </dependency>
+
+    <dependency>
+      <groupId>org.jboss.weld.integration</groupId>
+      <artifactId>weld-jboss-int-deployer-mc-int</artifactId>
+      <optional>true</optional>
+    </dependency>
    
     <dependency>
       <groupId>org.jboss.weld</groupId>
@@ -97,5 +103,24 @@
     </dependency>
       
    </dependencies>
+   
+   <profiles>
+      <profile>
+         <id>mc-int</id>
+         <build>
+            <plugins>
+               <plugin>
+                  <groupId>org.apache.maven.plugins</groupId>
+                  <artifactId>maven-assembly-plugin</artifactId>
+                  <configuration>
+                     <descriptors>
+                        <descriptor>src/main/assembly/assembly-mc-int.xml</descriptor>
+                     </descriptors>
+                  </configuration>
+               </plugin>
+            </plugins>
+         </build>
+      </profile>
+   </profiles>
 
 </project>

Added: projects/weld-int/trunk/assembly/src/main/assembly/assembly-mc-int.xml
===================================================================
--- projects/weld-int/trunk/assembly/src/main/assembly/assembly-mc-int.xml	                        (rev 0)
+++ projects/weld-int/trunk/assembly/src/main/assembly/assembly-mc-int.xml	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<assembly xmlns="http://maven.apache.org/POM/4.0.0"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="
+              http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd
+          ">   
+   
+   <baseDirectory>weld.deployer</baseDirectory>
+   
+   <formats>
+      <format>zip</format>
+   </formats>
+   
+   <fileSets>
+      <fileSet>
+         <directory>src/main/assembly/resources</directory>
+         <outputDirectory></outputDirectory>
+      </fileSet>
+   </fileSets>
+   
+   <dependencySets>
+      <dependencySet>
+         <outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
+         <includes>
+            <include>com.google.collections:google-collections</include>
+            <include>org.slf4j:slf4j-ext:jar</include>
+            <include>ch.qos.cal10n:cal10n-api</include>
+            <include>org.jboss.weld:weld-spi</include>
+            <include>org.jboss.weld.integration:weld-jboss-int-jboss-ejb</include>
+            <include>org.jboss.weld.integration:weld-jboss-int-deployer</include>
+            <include>org.jboss.weld.integration:weld-jboss-int-deployer-mc-int</include>
+            <include>org.jboss.weld.integration:weld-jboss-int-webtier</include>
+            <include>org.jboss.interceptor:jboss-interceptor</include>
+         </includes>
+      </dependencySet>
+      <dependencySet>
+         <useProjectArtifact>false</useProjectArtifact>
+         <outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
+         <outputDirectory>lib-int</outputDirectory>
+         <includes>
+            <include>org.jboss.weld:weld-core</include>
+         </includes>
+      </dependencySet>
+   </dependencySets>
+   
+</assembly>

Modified: projects/weld-int/trunk/assembly/src/main/assembly/resources/META-INF/weld-deployers-jboss-beans.xml
===================================================================
--- projects/weld-int/trunk/assembly/src/main/assembly/resources/META-INF/weld-deployers-jboss-beans.xml	2009-11-11 14:11:52 UTC (rev 96257)
+++ projects/weld-int/trunk/assembly/src/main/assembly/resources/META-INF/weld-deployers-jboss-beans.xml	2009-11-11 14:42:04 UTC (rev 96258)
@@ -64,5 +64,9 @@
   <!-- Responsible for binding bean managers -->
   <!--<bean name="JndiBinderDeployer" class="org.jboss.weld.integration.deployer.jndi.JndiBinderDeployer"/>-->
 
+  <!-- Adds plugin to BeanMetaDataDeployer that installs WeldKernelControllerContexts -->
+  <!-- bean name="WeldBeanMetaDataDeployerPlugin" class="org.jboss.weld.integration.deployer.mc.WeldBeanMetaDataDeployerPlugin"/ -->
+  
 
+
 </deployment>

Modified: projects/weld-int/trunk/deployer/pom.xml
===================================================================
--- projects/weld-int/trunk/deployer/pom.xml	2009-11-11 14:11:52 UTC (rev 96257)
+++ projects/weld-int/trunk/deployer/pom.xml	2009-11-11 14:42:04 UTC (rev 96258)
@@ -27,6 +27,29 @@
    		</snapshots>
    	</repository>
    </repositories>
+
+   <build>
+     <plugins>
+       <plugin>
+         <groupId>org.apache.maven.plugins</groupId>
+         <artifactId>maven-surefire-plugin</artifactId>
+         <!--configuration>
+           <testFailureIgnore>true</testFailureIgnore>
+         </configuration-->
+       </plugin>
+       <plugin>
+         <groupId>org.apache.maven.plugins</groupId>
+         <artifactId>maven-jar-plugin</artifactId>
+         <executions>
+           <execution>
+             <goals>
+               <goal>test-jar</goal>
+             </goals>
+           </execution>
+         </executions>
+       </plugin>
+     </plugins>
+   </build>
    
    <dependencies>
       

Modified: projects/weld-int/trunk/deployer/src/main/java/org/jboss/weld/integration/deployer/DeployersUtils.java
===================================================================
--- projects/weld-int/trunk/deployer/src/main/java/org/jboss/weld/integration/deployer/DeployersUtils.java	2009-11-11 14:11:52 UTC (rev 96257)
+++ projects/weld-int/trunk/deployer/src/main/java/org/jboss/weld/integration/deployer/DeployersUtils.java	2009-11-11 14:42:04 UTC (rev 96258)
@@ -24,6 +24,7 @@
 import java.util.Collection;
 import java.util.List;
 
+import org.jboss.beans.metadata.spi.BeanMetaData;
 import org.jboss.deployers.structure.spi.DeploymentUnit;
 
 /**
@@ -33,6 +34,8 @@
  */
 public final class DeployersUtils
 {
+   public static final String JAVAX_VALIDATION_VALIDATOR_FACTORY = "javax.validation.ValidatorFactory";
+
    private DeployersUtils()
    {
    }
@@ -57,6 +60,39 @@
       DeploymentUnit top = unit.getTopLevel();
       return top.getName() + WELD_BOOTSTRAP_BEAN;
    }
+   
+   /**
+    * 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
+    * @param unit The deployment unit
+    * @return the weld deployment bean name
+    */
+   public static String getDeploymentBeanName(DeploymentUnit unit)
+   {
+      return unit.getName() + "_JBossDeployment";
+   }
+   
+   /**
+    * Get the name of the weld deployment deployers attachment
+    * @param unit The deployment unit
+    * @return the deployer attachment name of the weld deployment
+    */
+   public static String getDeploymentAttachmentName(DeploymentUnit unit)
+   {
+      return getDeploymentBeanName(unit);
+   }
 
    /**
     * Check deployment hierarchy for beans.xml files.

Modified: projects/weld-int/trunk/deployer/src/main/java/org/jboss/weld/integration/deployer/env/AbstractDeploymentDeployer.java
===================================================================
--- projects/weld-int/trunk/deployer/src/main/java/org/jboss/weld/integration/deployer/env/AbstractDeploymentDeployer.java	2009-11-11 14:11:52 UTC (rev 96257)
+++ projects/weld-int/trunk/deployer/src/main/java/org/jboss/weld/integration/deployer/env/AbstractDeploymentDeployer.java	2009-11-11 14:42:04 UTC (rev 96258)
@@ -26,6 +26,7 @@
 import org.jboss.deployers.spi.DeploymentException;
 import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.weld.bootstrap.spi.Deployment;
+import org.jboss.weld.integration.deployer.DeployersUtils;
 
 /**
  * Abstract Deployment Deployer.
@@ -50,13 +51,10 @@
       if (isRelevant(unit) == false)
          return;
 
-      String unitName = unit.getName();
-      String deploymentName = unitName + "_JBossDeployment";
-
-      BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(deploymentName, getDeploymentClass().getName());
+      BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(DeployersUtils.getDeploymentBeanName(unit), getDeploymentClass().getName());
       buildDeployment(unit, info, builder);
-      info.setDeployment(builder.createInject(deploymentName));
-      unit.addAttachment(deploymentName, builder.getBeanMetaData(), BeanMetaData.class);
+      info.setDeployment(builder.createInject(DeployersUtils.getDeploymentBeanName(unit)));
+      unit.addAttachment(DeployersUtils.getDeploymentAttachmentName(unit), builder.getBeanMetaData(), BeanMetaData.class);
    }
 
    /**

Modified: projects/weld-int/trunk/deployer/src/main/java/org/jboss/weld/integration/deployer/env/WeldBootstrapDeployer.java
===================================================================
--- projects/weld-int/trunk/deployer/src/main/java/org/jboss/weld/integration/deployer/env/WeldBootstrapDeployer.java	2009-11-11 14:11:52 UTC (rev 96257)
+++ projects/weld-int/trunk/deployer/src/main/java/org/jboss/weld/integration/deployer/env/WeldBootstrapDeployer.java	2009-11-11 14:42:04 UTC (rev 96258)
@@ -47,7 +47,7 @@
       super(false);
       setDisableOptional(true);
       addOutput(BeanMetaData.class);
-      addInput("javax.validation.ValidatorFactory");
+      addInput(DeployersUtils.JAVAX_VALIDATION_VALIDATOR_FACTORY);
    }
 
    protected void deployInternal(DeploymentUnit unit, BootstrapInfo info) throws DeploymentException
@@ -85,7 +85,7 @@
       install.addParameterMetaData(String.class.getName(), "Start");
       install.addParameterMetaData(String.class.getName(), "Start");
       
-      unit.addAttachment(bootstrapName + "_" + BeanMetaData.class.getSimpleName(), bootstrap.getBeanMetaData());
+      unit.addAttachment(DeployersUtils.getBootstrapBeanAttachmentName(unit), bootstrap.getBeanMetaData());
 
       String injectorName = unit.getName() + "_WBInjector";
       BeanMetaDataBuilder weldInjector = BeanMetaDataBuilder.createBuilder(injectorName, WeldInjector.class.getName());
@@ -119,7 +119,7 @@
    
    protected ValueMetaData createValidationServices(DeploymentUnit unit) throws DeploymentException
    {
-      Object validatorFactory = unit.getAttachment("javax.validation.ValidatorFactory");
+      Object validatorFactory = unit.getAttachment(DeployersUtils.JAVAX_VALIDATION_VALIDATOR_FACTORY);
       
       if (validatorFactory == null)
       {
@@ -129,7 +129,7 @@
       String beanName = unit.getName() + "_JBossValidationServices";
       BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(beanName, "org.jboss.weld.integration.validation.JBossValidationServices");
       unit.addAttachment(beanName + "_" + BeanMetaData.class.getSimpleName(), builder.getBeanMetaData());
-      builder.addConstructorParameter("javax.validation.ValidatorFactory", validatorFactory);
+      builder.addConstructorParameter(DeployersUtils.JAVAX_VALIDATION_VALIDATOR_FACTORY, validatorFactory);
       return builder.createInject(beanName);
    }
 }

Modified: projects/weld-int/trunk/deployer/src/test/java/org/jboss/test/deployers/support/MockEjbServices.java
===================================================================
--- projects/weld-int/trunk/deployer/src/test/java/org/jboss/test/deployers/support/MockEjbServices.java	2009-11-11 14:11:52 UTC (rev 96257)
+++ projects/weld-int/trunk/deployer/src/test/java/org/jboss/test/deployers/support/MockEjbServices.java	2009-11-11 14:42:04 UTC (rev 96258)
@@ -30,11 +30,12 @@
 import org.jboss.weld.ejb.spi.EjbDescriptor;
 import org.jboss.weld.ejb.spi.EjbServices;
 import org.jboss.weld.ejb.spi.InterceptorBindings;
+import org.jboss.weld.injection.spi.EjbInjectionServices;
 
 /**
  * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
  */
-public class MockEjbServices implements EjbServices
+public class MockEjbServices implements EjbServices, EjbInjectionServices
 {
    public void setDeploymentUnit(DeploymentUnit unit)
    {

Added: projects/weld-int/trunk/deployer-mc-int/pom.xml
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/pom.xml	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/pom.xml	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,357 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+     <groupId>org.jboss.weld.integration</groupId>
+     <artifactId>weld-jboss-int</artifactId>
+     <version>5.2.0-SNAPSHOT</version>
+  </parent>
+
+  <groupId>org.jboss.weld.integration</groupId>
+  <artifactId>weld-jboss-int-deployer-mc-int</artifactId>
+  <version>5.2.0-SNAPSHOT</version>
+  <packaging>jar</packaging>
+  <name>Weld JBoss AS Integration: MC Deployers for injection between Weld and MC</name>
+  <description>Weld deployers for JBoss AS enabling injection between Weld and MC</description>
+
+  <repositories>
+    <repository>
+    <id>snapshots.jboss.org</id>
+    <name>JBoss Snapshot's Repository</name>
+    <url>http://snapshots.jboss.org/maven2</url>
+    <releases>
+      <enabled>false</enabled>
+      </releases>
+      <snapshots>
+        <enabled>true</enabled>
+        <updatePolicy>always</updatePolicy>
+      </snapshots>
+    </repository>
+  </repositories>
+
+   <properties>
+      <version.jboss.kernel>2.2.0-SNAPSHOT</version.jboss.kernel>
+      <version.jboss.deployers>2.2.0-SNAPSHOT</version.jboss.deployers>
+   </properties>
+
+   <dependencyManagement>
+      <!-- The parent pom manages the inter-dependencies of the modules. -->
+      <dependencies>
+         <dependency>
+            <groupId>org.jboss.deployers</groupId>
+            <artifactId>jboss-deployers-client</artifactId>
+            <version>${version.jboss.deployers}</version>
+         </dependency>
+         <dependency>
+            <groupId>org.jboss.deployers</groupId>
+            <artifactId>jboss-deployers-client-spi</artifactId>
+            <version>${version.jboss.deployers}</version>
+         </dependency>
+         <dependency>
+            <groupId>org.jboss.deployers</groupId>
+            <artifactId>jboss-deployers-core-spi</artifactId>
+            <version>${version.jboss.deployers}</version>
+         </dependency>
+         <dependency>
+            <groupId>org.jboss.deployers</groupId>
+            <artifactId>jboss-deployers-impl</artifactId>
+            <version>${version.jboss.deployers}</version>
+            <exclusions>
+               <exclusion>
+                  <groupId>org.jboss</groupId>
+                  <artifactId>javassist</artifactId>
+               </exclusion>
+            </exclusions>
+         </dependency>
+         <dependency>
+            <groupId>org.jboss.deployers</groupId>
+            <artifactId>jboss-deployers-spi</artifactId>
+            <version>${version.jboss.deployers}</version>
+         </dependency>
+         <dependency>
+            <groupId>org.jboss.deployers</groupId>
+            <artifactId>jboss-deployers-structure-spi</artifactId>
+            <version>${version.jboss.deployers}</version>
+         </dependency>
+         <dependency>
+            <groupId>org.jboss.deployers</groupId>
+            <artifactId>jboss-deployers-vfs</artifactId>
+            <version>${version.jboss.deployers}</version>
+         </dependency>
+          <dependency>
+            <groupId>org.jboss.deployers</groupId>
+            <artifactId>jboss-deployers-vfs-spi</artifactId>
+            <version>${version.jboss.deployers}</version>
+         </dependency>
+
+          <dependency>
+            <groupId>org.jboss.kernel</groupId>
+            <artifactId>jboss-dependency</artifactId>
+            <version>${version.jboss.kernel}</version>
+         </dependency>
+
+         <dependency>
+            <groupId>org.jboss.kernel</groupId>
+            <artifactId>jboss-kernel</artifactId>
+            <version>${version.jboss.kernel}</version>
+         </dependency>
+
+         <dependency>
+            <groupId>org.jboss.kernel</groupId>
+            <artifactId>jboss-weld-int</artifactId>
+            <version>${version.jboss.kernel}</version>
+         </dependency>
+         
+         <dependency>
+            <groupId>org.jboss.weld.integration</groupId>
+            <artifactId>weld-jboss-int-deployer</artifactId>
+            <version>${project.version}</version>
+         </dependency>
+
+         <dependency>
+            <groupId>org.jboss.weld.integration</groupId>
+            <artifactId>weld-jboss-int-deployer</artifactId>
+            <type>test-jar</type>
+            <scope>test</scope>
+            <version>${project.version}</version>
+         </dependency>
+         
+      </dependencies>
+   </dependencyManagement>
+ 
+
+
+  <dependencies>
+  
+    <dependency>
+      <groupId>org.jboss.weld.integration</groupId>
+      <artifactId>weld-jboss-int-jboss-ejb</artifactId>
+      <optional>true</optional>
+    </dependency>
+  
+    <dependency>
+      <groupId>org.jboss.weld.integration</groupId>
+      <artifactId>weld-jboss-int-deployer</artifactId>
+      <optional>true</optional>
+      <exclusions>
+        <exclusion>
+          <groupId>org.jboss</groupId>
+          <artifactId>jboss-reflect</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+  
+    <dependency>
+      <groupId>javax.enterprise</groupId>
+      <artifactId>cdi-api</artifactId>
+      <scope>provided</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.jboss.weld</groupId>
+      <artifactId>weld-spi</artifactId>
+      <scope>provided</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.jboss.cl</groupId>
+      <artifactId>jboss-classloader</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.jboss.deployers</groupId>
+      <artifactId>jboss-deployers-vfs</artifactId>
+      <scope>provided</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.jboss.kernel</groupId>
+      <artifactId>jboss-weld-int</artifactId>
+      <version>${version.jboss.kernel}</version>
+      <exclusions>
+        <exclusion>
+          <groupId>org.jboss.microcontainer</groupId>
+          <artifactId>jboss-kernel</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.jboss.microcontainer</groupId>
+          <artifactId>jboss-dependency</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.jboss</groupId>
+          <artifactId>jboss-common-core</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.jboss.logging</groupId>
+          <artifactId>jboss-logging-spi</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.jboss</groupId>
+          <artifactId>jbossxb</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+
+    <dependency>
+      <groupId>org.jboss.kernel</groupId>
+      <artifactId>jboss-dependency</artifactId>
+      <scope>provided</scope>
+      <exclusions>
+        <exclusion>
+          <groupId>org.jboss</groupId>
+          <artifactId>jboss-common-core</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.jboss.logging</groupId>
+          <artifactId>jboss-logging-spi</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.jboss.kernel</groupId>
+      <artifactId>jboss-kernel</artifactId>
+      <optional>true</optional>
+      <scope>provided</scope>
+      <exclusions>
+        <exclusion>
+          <groupId>org.jboss.microcontainer</groupId>
+          <artifactId>jboss-dependency</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.jboss</groupId>
+          <artifactId>jboss-common-core</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.jboss.logging</groupId>
+          <artifactId>jboss-logging-spi</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.jboss</groupId>
+          <artifactId>jbossxb</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+
+    <dependency>
+      <groupId>org.jboss</groupId>
+      <artifactId>jbossxb</artifactId>
+      <optional>true</optional>
+      <scope>provided</scope>
+      <exclusions>
+        <exclusion>
+          <groupId>org.jboss</groupId>
+          <artifactId>jboss-reflect</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.jboss</groupId>
+          <artifactId>jboss-common-core</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.jboss.logging</groupId>
+          <artifactId>jboss-logging-spi</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    
+
+    <!-- Test dependencies -->
+
+    <dependency>
+      <groupId>org.jboss.weld.integration</groupId>
+      <artifactId>weld-jboss-int-deployer</artifactId>
+      <type>test-jar</type>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.jboss.deployers</groupId>
+      <artifactId>jboss-deployers-vfs</artifactId>
+      <type>test-jar</type>
+      <scope>test</scope>
+      <!--
+      <exclusions>
+        <exclusion>
+          <groupId>org.jboss.deployers</groupId>
+          <artifactId>jboss-deployers-impl</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.jboss.deployers</groupId>
+          <artifactId>jboss-deployers-spi</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.jboss.microcontainer</groupId>
+          <artifactId>jboss-kernel</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.jboss.cl</groupId>
+          <artifactId>jboss-classloading</artifactId>
+        </exclusion>
+      </exclusions>
+      -->
+    </dependency>
+
+    <dependency>
+      <groupId>org.jboss.test</groupId>
+      <artifactId>jboss-test</artifactId>
+      <scope>test</scope>
+      <exclusions>
+        <exclusion>
+          <groupId>org.jboss</groupId>
+          <artifactId>jboss-common-core</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.jboss.logging</groupId>
+          <artifactId>jboss-logging-spi</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.jboss.logging</groupId>
+          <artifactId>jboss-logging-log4j</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>jboss.profiler.jvmti</groupId>
+          <artifactId>jboss-profiler-jvmti</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>log4j</groupId>
+          <artifactId>log4j</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>junit</groupId>
+          <artifactId>junit</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.apache.ant</groupId>
+          <artifactId>ant</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.apache.ant</groupId>
+          <artifactId>ant-junit</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+
+    <dependency>
+      <groupId>org.jboss.ejb3</groupId>
+      <artifactId>jboss-ejb3-core</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-simple</artifactId>
+      <version>${version.slf4j}</version>
+      <scope>test</scope>
+    </dependency>
+
+  </dependencies>
+  
+  
+  
+</project>

Added: projects/weld-int/trunk/deployer-mc-int/src/main/java/org/jboss/weld/integration/App.java
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/main/java/org/jboss/weld/integration/App.java	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/main/java/org/jboss/weld/integration/App.java	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,13 @@
+package org.jboss.weld.integration;
+
+/**
+ * Hello world!
+ *
+ */
+public class App 
+{
+    public static void main( String[] args )
+    {
+        System.out.println( "Hello World!" );
+    }
+}

Added: projects/weld-int/trunk/deployer-mc-int/src/main/java/org/jboss/weld/integration/deployer/mc/BeanMetaDataPropertyHolder.java
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/main/java/org/jboss/weld/integration/deployer/mc/BeanMetaDataPropertyHolder.java	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/main/java/org/jboss/weld/integration/deployer/mc/BeanMetaDataPropertyHolder.java	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,58 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.weld.integration.deployer.mc;
+
+import org.jboss.beans.metadata.spi.BeanMetaData;
+
+/**
+ * Due to http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4263782#4263782
+ * BeanMetaData cannot be used directly as a property of a bean. Create this intermediate 
+ * class instead
+ *  
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanMetaDataPropertyHolder
+{
+   private final BeanMetaData beanMetaData;
+   
+   /**
+    * Constructor
+    * @param beanMetaData The bean metadata to wrap
+    * @throws IllegalArgumentException if beanMetaData is null
+    */
+   public BeanMetaDataPropertyHolder(BeanMetaData beanMetaData)
+   {
+      if (beanMetaData == null)
+         throw new IllegalArgumentException("Null bean metadata");
+      this.beanMetaData = beanMetaData;
+   }
+
+   /**
+    * Get the bean metadata
+    * @return the bean metadata
+    */
+   public BeanMetaData getBeanMetaData()
+   {
+      return beanMetaData;
+   }
+}

Added: projects/weld-int/trunk/deployer-mc-int/src/main/java/org/jboss/weld/integration/deployer/mc/IntermediateWeldBootstrapBean.java
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/main/java/org/jboss/weld/integration/deployer/mc/IntermediateWeldBootstrapBean.java	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/main/java/org/jboss/weld/integration/deployer/mc/IntermediateWeldBootstrapBean.java	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,221 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2009, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.weld.integration.deployer.mc;
+
+import javax.enterprise.inject.spi.BeanManager;
+
+import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.kernel.weld.plugins.dependency.WeldKernelControllerContext;
+import org.jboss.logging.Logger;
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.weld.bootstrap.spi.Deployment;
+import org.jboss.weld.integration.deployer.env.helpers.BootstrapBean;
+
+/**
+ * Intermediate bean installed by BeanMetaDataDeployer using {@link WeldBeanMetaDataDeployerPlugin}.
+ * It holds the BeanMetaData BeanMetaDataDeployer thinks it is installing and gets injected with the 
+ * Weld BootstrapBean and Deployment once the Weld BootstrapBean has been initialized. Once that happens
+ * we can get a reference to the Weld BeanManager so that we can create a WeldKernelControllerContext
+ * with the original BeanMetaData during this bean's start stage. The created WeldKernelControllerContext
+ * contains an install callback to remove this intermediate bean from the controller.
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class IntermediateWeldBootstrapBean
+{
+   final static Logger log = Logger.getLogger(IntermediateWeldBootstrapBean.class.getName());
+   
+   /**
+    * The bootstrap bean
+    */
+   private BootstrapBean bootstrapBean;
+   
+   /**
+    * The weld deployment containing this bean 
+    */
+   private Deployment deployment;
+   
+   /**
+    * The actual MC bean metadata we want to install as a weld kernel controller context
+    */
+   private BeanMetaDataPropertyHolder beanMetaDataHolder;
+   
+   /**
+    * The controller context of this bean
+    */
+   private ControllerContext context;
+   
+   /**
+    * The WeldKernelControllerContextCreator that created this bean.
+    */
+   private WeldBeanMetaDataDeployerPlugin creator;
+
+   /**
+    * Get the bootstrapBean
+    * @return the bootstrapBean
+    */
+   public BootstrapBean getBootstrapBean()
+   {
+      return bootstrapBean;
+   }
+
+   /**
+    * Set the bootstrapBean
+    * @param bootstrapBean the bootstrapBean to set
+    */
+   public void setBootstrapBean(BootstrapBean bootstrapBean)
+   {
+      this.bootstrapBean = bootstrapBean;
+   }
+
+   /**
+    * Get the deployment
+    * @return the deployment
+    */
+   public Deployment getDeployment()
+   {
+      return deployment;
+   }
+
+   /**
+    * Set the deployment
+    * @param deployment the deployment to set
+    */
+   public void setDeployment(Deployment deployment)
+   {
+      this.deployment = deployment;
+   }
+
+
+   /**
+    * Get the context
+    * @return the context
+    */
+   public ControllerContext getContext()
+   {
+      return context;
+   }
+
+   /**
+    * Set the context
+    * @param context the context to set
+    */
+   public void setContext(ControllerContext context)
+   {
+      this.context = context;
+   }
+
+   /**
+    * Get the beanMetaDataHolder
+    * @return the beanMetaDataHolder
+    */
+   public BeanMetaDataPropertyHolder getBeanMetaDataHolder()
+   {
+      return beanMetaDataHolder;
+   }
+
+   /**
+    * Set the beanMetaDataHolder
+    * @param beanMetaDataHolder the beanMetaDataHolder to set
+    */
+   public void setBeanMetaDataHolder(BeanMetaDataPropertyHolder beanMetaDataHolder)
+   {
+      this.beanMetaDataHolder = beanMetaDataHolder;
+   }
+
+   /**
+    * Get the creator
+    * @return the creator
+    */
+   public WeldBeanMetaDataDeployerPlugin getCreator()
+   {
+      return creator;
+   }
+
+   /**
+    * Set the creator
+    * @param creator the creator to set
+    */
+   public void setCreator(WeldBeanMetaDataDeployerPlugin creator)
+   {
+      this.creator = creator;
+   }
+
+   /**
+    * Called when the bean starts, and checks that it has been injected with the necessary bootstrapBean,
+    * beanMetaData, context and deployment to create a WeldKernelControllerContext.
+    * 
+    * @throws IllegalStateException if bootstrapBean, beanMetaDataHolder, context or deployment have not been set.
+    * @throws Exception if an error occured installing the bean
+    */
+   public void create() throws Exception
+   {
+      if (bootstrapBean == null)
+         throw new IllegalStateException("Null bootstrap bean");
+      if (beanMetaDataHolder == null)
+         throw new IllegalStateException("Null bean metadata");
+      if (context == null)
+         throw new IllegalStateException("Null context");
+      if (deployment == null)
+         throw new IllegalStateException("Null deployment");
+      if (deployment.getBeanDeploymentArchives().size() == 0)
+         throw new IllegalStateException("Zero bean deployment archives in the deployment");
+      
+      BeanDeploymentArchive archive = deployment.getBeanDeploymentArchives().iterator().next();
+      
+      if (deployment.getBeanDeploymentArchives().size() > 1)
+         log.warn("More than one bean deployment archives, using the first " + archive);
+      
+      BeanManager manager = bootstrapBean.getBootstrap().getManager(archive);
+      if (manager == null)
+         throw new IllegalStateException("Could not find a manager for archive " + null);
+      
+      //When the created weld kernel controller context is installed, call installCreatedBean() which removes 
+      //this bean from the controller
+      BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(beanMetaDataHolder.getBeanMetaData());
+      builder.addInstallWithParameters("installCreatedBean", (String)context.getName(), ControllerState.INSTALLED);
+      
+      WeldKernelControllerContext ctx = new WeldKernelControllerContext(null, beanMetaDataHolder.getBeanMetaData(), null, manager);
+
+      try
+      {
+         context.getController().install(ctx);
+      }
+      catch(Throwable t)
+      {
+         throw new Exception(t);
+      }
+      creator.removeIntermediateBean(beanMetaDataHolder.getBeanMetaData().getName());
+   }
+   
+   /**
+    * Called when the created bean reaches INSTALLED state.
+    * Uninstalls the context of this temp bean
+    */
+   public void installCreatedBean()
+   {
+      context.getController().uninstall(context.getName());
+   }
+}

Added: projects/weld-int/trunk/deployer-mc-int/src/main/java/org/jboss/weld/integration/deployer/mc/WeldBeanMetaDataDeployerPlugin.java
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/main/java/org/jboss/weld/integration/deployer/mc/WeldBeanMetaDataDeployerPlugin.java	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/main/java/org/jboss/weld/integration/deployer/mc/WeldBeanMetaDataDeployerPlugin.java	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,142 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2009, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.weld.integration.deployer.mc;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.jboss.beans.metadata.api.model.FromContext;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
+import org.jboss.dependency.spi.Controller;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.vfs.spi.deployer.helpers.BeanMetaDataDeployerPlugin;
+import org.jboss.kernel.plugins.dependency.AbstractKernelControllerContext;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.weld.integration.deployer.DeployersUtils;
+
+/**
+ * KernelContextCreator to create MC beans that are part of a Weld deployment. These beans must
+ * be installed as WeldKernelControllerContexts. Rather than creating the WeldKernelControllerContext's
+ * rignt away we create some intermediate beans which get injected with the Weld BootstrapBean once that is up and running
+ * which can be used to create WeldKernelControllerContexts later.
+ * 
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class WeldBeanMetaDataDeployerPlugin implements BeanMetaDataDeployerPlugin
+{
+   public static int DEFAULT_ORDER = 50;
+   
+   private final int order;
+   
+   private final String[] ignoredSuffixes = new String[] {"_JBossDeployment", "_JBossEjbServices", "_WBInjector", "_JBossJpaServices", "_JBossValidationServices", "_WeldBootstrap", "_WeldBootstrapBean"};
+
+   /** Map of real bean names and intermediate bean names */
+   private final Map<Object, Object> intermediateBeans = new ConcurrentHashMap<Object, Object>();
+   
+   public WeldBeanMetaDataDeployerPlugin()
+   {
+      this(-1);
+   }
+   
+   public WeldBeanMetaDataDeployerPlugin(int order)
+   {
+      if (order > 0)
+         this.order = order;
+      else
+         this.order = DEFAULT_ORDER;
+   }
+   
+   public int getRelativeOrder()
+   {
+      return order;
+   }
+
+   /**
+    * Create KernelControllerContexts for the intermediate beans (See: {@link IntermediateWeldBootstrapBean}) that will be 
+    * used to create WeldKernelContexts once everything is ready.
+    *  
+    * @param controller The controller to which the beans will be deployed
+    * @param unit The deployment unit we are deploying
+    * @param beanMetaData The bean metadata we are deploying
+    * @return the created controller context or null if the context is one of the weld ones which should be installed read   
+    */
+   public KernelControllerContext createContext(Controller controller, DeploymentUnit unit, BeanMetaData beanMetaData)
+   {
+      if (unit.getTopLevel().getAttachment(DeployersUtils.getBootstrapBeanAttachmentName(unit)) == null)
+      {
+         //Not a Weld deployment
+         return null;
+      }
+      for (String suffix : ignoredSuffixes)
+      {
+         if (beanMetaData.getName().endsWith(suffix))
+         {
+            if (beanMetaData.getName().equals(unit.getTopLevel().getName() + suffix))
+            {
+               //Install Weld deployment bean as normal KernelControllerContext
+               return null;
+            }
+         }
+      }
+      
+      String beanName = unit.getTopLevel().getName() + "BootstrapBeanInstaller=" + beanMetaData.getName();
+      BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(beanName, IntermediateWeldBootstrapBean.class.getName());
+      builder.addPropertyMetaData("bootstrapBean", builder.createInject(DeployersUtils.getBootstrapBeanName(unit), null, ControllerState.CONFIGURED, ControllerState.CREATE));
+      builder.addPropertyMetaData("beanMetaDataHolder", new BeanMetaDataPropertyHolder(beanMetaData));
+      builder.addPropertyMetaData("context", builder.createFromContextInject(FromContext.CONTEXT));
+      builder.addPropertyMetaData("deployment", builder.createInject(DeployersUtils.getDeploymentBeanName(unit.getTopLevel())));
+      builder.addPropertyMetaData("creator", builder.createValue(this));
+      KernelControllerContext ctx = new AbstractKernelControllerContext(null, builder.getBeanMetaData(), null);
+      
+      intermediateBeans.put(beanMetaData.getName(), beanName);
+      
+      return ctx;
+   }
+   
+   public boolean uninstallContext(Controller controller, DeploymentUnit unit, BeanMetaData beanMetaData)
+   {
+      //Only remove the intermediate bean if there is one
+      Object intermediateBean = intermediateBeans.remove(beanMetaData.getName());
+      if (intermediateBean != null)
+      {
+         if (controller.getContext(intermediateBean, null) != null)
+         {
+            controller.uninstall(intermediateBean);
+         }
+      }
+      //Check that the real bean was deployed by the intermediate bean before undeploying it
+      if (controller.getContext(beanMetaData.getName(), null) != null)
+         controller.uninstall(beanMetaData.getName());   
+      
+      //Return true to signal BeanMetaDataDeployer that we have undeployed everything 
+      return true;
+   }
+   
+   public void removeIntermediateBean(String name)
+   {
+      intermediateBeans.remove(name);
+   }
+}

Added: projects/weld-int/trunk/deployer-mc-int/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1 @@
+org.jboss.kernel.weld.plugins.weld.McBeanRegistryObserver
\ No newline at end of file

Added: projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/MockJBossJpaServices.java
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/MockJBossJpaServices.java	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/MockJBossJpaServices.java	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,59 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.test.deployers.support;
+
+import javax.enterprise.inject.spi.InjectionPoint;
+import javax.naming.NamingException;
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+
+import org.jboss.weld.injection.spi.JpaInjectionServices;
+import org.jboss.weld.integration.util.AbstractJBossServices;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class MockJBossJpaServices extends AbstractJBossServices implements JpaInjectionServices
+{
+   public MockJBossJpaServices() throws NamingException
+   {
+      // FIXME MockJBossJpaServices constructor
+      super();
+   }
+
+   public EntityManager resolvePersistenceContext(InjectionPoint injectionPoint)
+   {
+      return null;
+   }
+
+   public EntityManagerFactory resolvePersistenceUnit(InjectionPoint injectionPoint)
+   {
+      return null;
+   }
+
+   public void cleanup()
+   {
+   }
+
+}

Added: projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/MockPersistenceUnitDependencyResolver.java
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/MockPersistenceUnitDependencyResolver.java	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/MockPersistenceUnitDependencyResolver.java	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.test.deployers.support;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.jpa.resolvers.PersistenceUnitDependencyResolver;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class MockPersistenceUnitDependencyResolver implements PersistenceUnitDependencyResolver
+{
+
+   public String createBeanName(DeploymentUnit deploymentUnit, String persistenceUnitName)
+   {
+      return "persistence.unit:unitName=#1";
+   }
+
+   public String resolvePersistenceUnitSupplier(DeploymentUnit deploymentUnit, String persistenceUnitName)
+   {
+      return createBeanName(deploymentUnit, persistenceUnitName);
+   }
+
+}

Added: projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/deployer/MockValidatorFactoryDeployer.java
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/deployer/MockValidatorFactoryDeployer.java	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/deployer/MockValidatorFactoryDeployer.java	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,160 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.test.deployers.support.deployer;
+
+import java.util.Collections;
+import java.util.Locale;
+import java.util.Set;
+
+import javax.validation.ConstraintViolation;
+import javax.validation.MessageInterpolator;
+import javax.validation.TraversableResolver;
+import javax.validation.ValidationException;
+import javax.validation.Validator;
+import javax.validation.ValidatorContext;
+import javax.validation.ValidatorFactory;
+import javax.validation.metadata.BeanDescriptor;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.weld.integration.deployer.DeployersUtils;
+import org.jboss.weld.integration.deployer.env.AbstractBootstrapInfoDeployer;
+import org.jboss.weld.integration.deployer.env.BootstrapInfo;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class MockValidatorFactoryDeployer extends AbstractBootstrapInfoDeployer
+{
+   public MockValidatorFactoryDeployer()
+   {
+      super(true);
+      addOutput(DeployersUtils.JAVAX_VALIDATION_VALIDATOR_FACTORY);
+   }
+
+   @Override
+   protected void deployInternal(DeploymentUnit unit, BootstrapInfo info) throws DeploymentException
+   {
+      unit.addAttachment(DeployersUtils.JAVAX_VALIDATION_VALIDATOR_FACTORY, MockValidatorFactory.INSTANCE);
+   }
+
+   private static class MockValidatorFactory implements ValidatorFactory
+   {
+      static ValidatorFactory INSTANCE = new MockValidatorFactory();
+      
+      private static Validator validator = new MockValidator();
+      
+      private static ValidatorContext context = new MockValidatorContext(validator);
+      
+      private static MessageInterpolator messageInterpolator = new MockMessageInterpolator();
+      
+      public MessageInterpolator getMessageInterpolator()
+      {
+         return messageInterpolator;
+      }
+
+      public Validator getValidator()
+      {
+         return validator;
+      }
+
+      public <T> T unwrap(Class<T> type)
+      {
+         throw new ValidationException("NYI");
+      }
+
+      public ValidatorContext usingContext()
+      {
+         return context;
+      }
+   }
+   
+   private static class MockValidatorContext implements ValidatorContext 
+   {
+      Validator validator;
+      
+      public MockValidatorContext(Validator validator)
+      {
+         this.validator = validator;
+      }
+      public Validator getValidator()
+      {
+         return validator;
+      }
+
+      public ValidatorContext messageInterpolator(MessageInterpolator messageInterpolator)
+      {
+         return this;
+      }
+
+      public ValidatorContext traversableResolver(TraversableResolver traversableResolver)
+      {
+         return this;
+      }
+   }
+   
+   private static class MockValidator implements Validator
+   {
+      public BeanDescriptor getConstraintsForClass(Class<?> clazz)
+      {
+         throw new ValidationException("NYI");
+      }
+
+      public <T> T unwrap(Class<T> type)
+      {
+         throw new ValidationException("NYI");
+      }
+
+      public <T> Set<ConstraintViolation<T>> validate(T object, Class<?>... groups)
+      {
+         return Collections.emptySet();
+      }
+
+      public <T> Set<ConstraintViolation<T>> validateProperty(T object, String propertyName, Class<?>... groups)
+      {
+         return Collections.emptySet();
+      }
+
+      public <T> Set<ConstraintViolation<T>> validateValue(Class<T> beanType, String propertyName, Object value,
+            Class<?>... groups)
+      {
+         return Collections.emptySet();
+      }
+   }
+   
+   private static class MockMessageInterpolator implements MessageInterpolator
+   {
+
+      public String interpolate(String messageTemplate, Context context)
+      {
+         return messageTemplate;
+      }
+
+      public String interpolate(String messageTemplate, Context context, Locale locale)
+      {
+         return messageTemplate;
+      }
+      
+   }
+}

Added: projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/bidirectional/end/First.java
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/bidirectional/end/First.java	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/bidirectional/end/First.java	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,44 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.test.deployers.support.mcandweld.bidirectional.end;
+
+import javax.enterprise.inject.Default;
+import javax.inject.Inject;
+
+import org.jboss.test.deployers.support.mcandweld.bidirectional.middle.Middle;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at Default
+public class First
+{
+   @Inject @Default
+   Middle middle;
+
+   public Middle getMiddle()
+   {
+      return middle;
+   }
+}

Added: projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/bidirectional/end/Last.java
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/bidirectional/end/Last.java	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/bidirectional/end/Last.java	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,35 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.test.deployers.support.mcandweld.bidirectional.end;
+
+import javax.enterprise.inject.Default;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at Default
+public class Last
+{
+
+}

Added: projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/bidirectional/middle/Middle.java
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/bidirectional/middle/Middle.java	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/bidirectional/middle/Middle.java	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,44 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.test.deployers.support.mcandweld.bidirectional.middle;
+
+import javax.enterprise.inject.Default;
+import javax.inject.Inject;
+
+import org.jboss.test.deployers.support.mcandweld.bidirectional.end.Last;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at Default
+public class Middle
+{
+   @Inject @Default
+   Last last;
+
+   public Last getLast()
+   {
+      return last;
+   }
+}

Added: projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/mc/fromweld/McBeanWithInjectedWeldBean.java
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/mc/fromweld/McBeanWithInjectedWeldBean.java	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/mc/fromweld/McBeanWithInjectedWeldBean.java	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,43 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.test.deployers.support.mcandweld.mc.fromweld;
+
+import javax.enterprise.inject.Default;
+import javax.inject.Inject;
+
+import org.jboss.test.deployers.support.mcandweld.weld.simple.SimpleWebBean;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class McBeanWithInjectedWeldBean
+{
+   @Inject @Default
+   SimpleWebBean simpleWebBean;
+
+   public SimpleWebBean getSimpleWebBean()
+   {
+      return simpleWebBean;
+   }
+}

Added: projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/mc/simple/SimpleBean.java
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/mc/simple/SimpleBean.java	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/mc/simple/SimpleBean.java	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,38 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.test.deployers.support.mcandweld.mc.simple;
+
+import javax.enterprise.inject.Default;
+
+import org.jboss.kernel.weld.metadata.api.annotations.WeldEnabled;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at Default
+ at WeldEnabled
+public class SimpleBean
+{
+
+}

Added: projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/weld/frommc/WeldBeanWithInjectedMcBean.java
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/weld/frommc/WeldBeanWithInjectedMcBean.java	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/weld/frommc/WeldBeanWithInjectedMcBean.java	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,43 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.test.deployers.support.mcandweld.weld.frommc;
+
+import javax.enterprise.inject.Default;
+import javax.inject.Inject;
+
+import org.jboss.test.deployers.support.mcandweld.mc.simple.SimpleBean;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class WeldBeanWithInjectedMcBean
+{
+   @Inject @Default
+   SimpleBean bean;
+   
+   public SimpleBean getSimpleBean()
+   {
+      return bean;
+   }
+}

Added: projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/weld/simple/SimpleWebBean.java
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/weld/simple/SimpleWebBean.java	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/support/mcandweld/weld/simple/SimpleWebBean.java	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,32 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.test.deployers.support.mcandweld.weld.simple;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class SimpleWebBean
+{
+
+}

Added: projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/test/AbstractWeldTest.java
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/test/AbstractWeldTest.java	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/test/AbstractWeldTest.java	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,263 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.deployers.test;
+
+import java.lang.reflect.Method;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+
+import org.jboss.classloader.plugins.jdk.AbstractJDKChecker;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.dependency.spi.DependencyInfo;
+import org.jboss.dependency.spi.DependencyItem;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataFactoryVisitor;
+import org.jboss.test.deployers.BootstrapDeployersTest;
+import org.jboss.virtual.AssembledDirectory;
+import org.jboss.weld.bootstrap.api.Bootstrap;
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.weld.integration.deployer.DeployersUtils;
+import org.jboss.weld.integration.deployer.env.FlatDeployment;
+
+/**
+ * AbstractWeldTest.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public abstract class AbstractWeldTest extends BootstrapDeployersTest
+{
+   protected AbstractWeldTest(String name)
+   {
+      super(name);
+   }
+
+   @Override
+   protected void setUp() throws Exception
+   {
+      // excluding class that knows hot to load from system classloader
+      Set<Class<?>> excluded = AbstractJDKChecker.getExcluded();
+      excluded.add(BeanMetaDataFactoryVisitor.class);
+
+      super.setUp();
+   }
+
+   protected void assertInstanceOf(Object target, String className, ClassLoader cl) throws Exception
+   {
+      Class<?> clazz = cl.loadClass(className);
+      assertTrue(clazz.isInstance(target));
+   }
+
+   protected boolean invoke(Object target, String name) throws Exception
+   {
+      Method m = target.getClass().getMethod("is" + name);
+      return (Boolean)m.invoke(target);
+   }
+
+//   protected AssembledDirectory createBasicEar() throws Exception
+//   {
+//      return createBasicEar(SomeUtil.class);
+//   }
+//
+//   protected AssembledDirectory createTopLevelWithUtil() throws Exception
+//   {
+//      return createTopLevelWithUtil("/weld/simple");
+//   }
+//
+//   protected AssembledDirectory createTopLevelWithUtil(Class<?> utilClass) throws Exception
+//   {
+//      return createTopLevelWithUtil("/weld/simple", utilClass);
+//   }
+//
+//   protected AssembledDirectory createTopLevelWithUtil(String path) throws Exception
+//   {
+//      return createTopLevelWithUtil(path, SomeUtil.class);
+//   }
+//
+//   protected AssembledDirectory createTopLevelWithUtil(String path, Class<?> utilClass) throws Exception
+//   {
+//      AssembledDirectory topLevel = createAssembledDirectory("top-level.ear", "top-level.ear");
+//      addPath(topLevel, path, "META-INF");
+//
+//      AssembledDirectory earLib = topLevel.mkdir("lib");
+//
+//      AssembledDirectory util = earLib.mkdir("util.jar");
+//      addPackage(util, utilClass);
+//
+//      AssembledDirectory ext = earLib.mkdir("ext.jar");
+//      addPackage(ext, ExternalWebBean.class);
+//      addPath(ext, "/weld/simple/ext", "META-INF");
+//
+//      return topLevel;
+//   }
+//
+//   protected AssembledDirectory createWarInEar() throws Exception
+//   {
+//      AssembledDirectory ear = createAssembledDirectory("war-in-ear.ear", "war-in-ear.ear");
+//      addPath(ear, "/weld/warinear", "META-INF");
+//
+//      AssembledDirectory war = ear.mkdir("simple.war");
+//      AssembledDirectory webinf = war.mkdir("WEB-INF");
+//      AssembledDirectory classes = webinf.mkdir("classes");
+//      addPackage(classes, ServletWebBean.class);
+//      addPath(war, "/weld/simple/web", "WEB-INF");
+//
+//      return ear;
+//   }
+//
+//   protected AssembledDirectory createJarInEar() throws Exception
+//   {
+//      AssembledDirectory ear = createAssembledDirectory("jar-in-ear.ear", "jar-in-ear.ear");
+//      addPath(ear, "/weld/jarinear", "META-INF");
+//
+//      AssembledDirectory jar = ear.mkdir("simple.jar");
+//      addPackage(jar, PlainJavaBean.class);
+//      addPath(jar, "/weld/simple/jar", "META-INF");
+//
+//      return ear;
+//   }
+//
+//   protected AssembledDirectory createWar(String warName, Class<?> reference) throws Exception
+//   {
+//      AssembledDirectory war = createAssembledDirectory(warName, warName);
+//      AssembledDirectory webinf = war.mkdir("WEB-INF");
+//      AssembledDirectory classes = webinf.mkdir("classes");
+//      addPackage(classes, reference);
+//      addPath(war, "/weld/simple/web", "WEB-INF");
+//      return war;
+//   }
+//
+//   protected AssembledDirectory createEjbJar(String jarName, Class<?> reference) throws Exception
+//   {
+//      AssembledDirectory jar = createAssembledDirectory(jarName, jarName);
+//      addPackage(jar, reference);
+//      addPath(jar, "/weld/simple/ejb", "META-INF");
+//      return jar;
+//   }
+   
+   protected void createMcLib(AssembledDirectory dir, String metaInfParent, Class<?> clazz) throws Exception
+   {
+      AssembledDirectory mcDir = dir.mkdir("mc.jar"); 
+      addPackage(mcDir, clazz);
+      addPath(mcDir, metaInfParent, "META-INF");
+   }
+   
+   protected void createWeldLib(AssembledDirectory dir, String metaInfParent, Class<?> clazz) throws Exception
+   {
+      AssembledDirectory weldDir = dir.mkdir("weld.jar");
+      addPackage(weldDir, clazz);
+      addPath(weldDir, metaInfParent, "META-INF");
+   }
+
+   protected Class<?> findClass(DeploymentUnit unit, String name, boolean mustFind)
+   {
+      //The class is loaded by a different classloader, so search for the correct class
+      FlatDeployment flatDeployment = (FlatDeployment)getBean(DeployersUtils.getDeploymentBeanName(unit));
+      assertNotNull(flatDeployment);
+      Class<?> found = null;
+      for (Class<?> current : flatDeployment.getFlatBeanDeploymentArchive().getBeanClasses())
+      {
+         if (name.equals(current.getName()))
+         {
+            found = current;
+            break;
+         }
+      }
+      if (mustFind)
+         assertNotNull(found);
+      return found;
+   }
+   
+   protected Object assertWebBean(BeanManager manager, DeploymentUnit unit, String className) throws Exception
+   {
+      Class<?> clazz = findClass(unit, className, true);
+      Set<Bean<?>> beans = manager.getBeans(clazz);
+      assertNotNull(beans);
+      Bean<?> bean = manager.resolve(beans);
+      assertNotNull(bean);
+      
+      Object ref = manager.getReference(bean, clazz, manager.createCreationalContext(bean));
+      assertNotNull(ref);
+      return ref;
+   }
+   
+   protected Object assertWebBean(BeanManager manager, DeploymentUnit unit, Object o) throws Exception
+   {
+      Set<Bean<?>> beans = manager.getBeans(o.getClass());
+      assertNotNull(beans);
+      Bean<?> bean = manager.resolve(beans);
+      assertNotNull(bean);
+      
+      Object ref = manager.getReference(bean, o.getClass(), manager.createCreationalContext(bean));
+      assertNotNull(ref);
+      return ref;
+   }
+   
+   protected void assertNoWebBean(BeanManager manager, DeploymentUnit unit, String className) throws Exception
+   {
+      Class<?> clazz = findClass(unit, className, false);
+      if (clazz != null)
+      {
+         Set<Bean<?>> beans = manager.getBeans(clazz);
+         assertTrue(beans.isEmpty());
+      }
+   }
+   
+   protected void outputContext(ControllerContext context)
+   {
+      System.out.println(context.getName() + " " + context.getState());
+      
+      DependencyInfo di = context.getDependencyInfo();
+      
+      for (DependencyItem item : di.getUnresolvedDependencies(null))
+      {
+         System.out.println(item);
+      }
+   }
+   
+   protected BeanManager getBeanManager(DeploymentUnit unit) throws Exception
+   {
+      ControllerContext context = getControllerContext(DeployersUtils.getBootstrapBeanName(unit));
+      assertNotNull(context);
+      //Check the bootstrap bean has been installed
+      assertNotNull(context.getTarget());
+      
+      Method m = context.getTarget().getClass().getMethod("getBootstrap"); 
+      Object o = m.invoke(context.getTarget());
+      assertNotNull(o);
+      assertInstanceOf(o, Bootstrap.class);
+      
+      BeanManager manager = ((Bootstrap)o).getManager(getBeanDeploymentArchive(unit));
+      assertNotNull(manager);
+      return manager;
+   }
+   
+   
+   protected BeanDeploymentArchive getBeanDeploymentArchive(DeploymentUnit unit)
+   {
+      FlatDeployment flatDeployment = (FlatDeployment)getBean(DeployersUtils.getDeploymentBeanName(unit));
+      assertNotNull(flatDeployment);
+      return flatDeployment.getFlatBeanDeploymentArchive();
+   }
+
+}
\ No newline at end of file

Added: projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/test/McIntegrationNoBootstrapBeanTestCase.java
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/test/McIntegrationNoBootstrapBeanTestCase.java	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/test/McIntegrationNoBootstrapBeanTestCase.java	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,92 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.deployers.test;
+
+import junit.framework.Test;
+
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.deployers.client.spi.DeployerClient;
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.test.deployers.support.mcandweld.mc.simple.SimpleBean;
+import org.jboss.test.deployers.support.mcandweld.weld.simple.SimpleWebBean;
+import org.jboss.virtual.AssembledDirectory;
+import org.jboss.weld.integration.deployer.DeployersUtils;
+import org.jboss.weld.integration.deployer.env.FlatDeployment;
+
+/**
+ * Test boot deployer.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class McIntegrationNoBootstrapBeanTestCase extends AbstractWeldTest
+{
+   public McIntegrationNoBootstrapBeanTestCase(String name)
+   {
+      super(name);
+   }
+
+   public static Test suite()
+   {
+      return suite(McIntegrationNoBootstrapBeanTestCase.class);
+   }
+   
+   public void testUninstallOfIntermediateBeanIfBeanManagerWasNotInstalled() throws Throwable
+   {
+      DeployerClient mainDeployer = getDeployerClient();
+      AssembledDirectory ear = createAssembledDirectory("top-level.ear", "top-level.ear");
+      addPath(ear, "/weld/mcandweld/ear/weldandmc", "META-INF");
+      createMcLib(ear, "/weld/mcandweld/mc/simple", SimpleBean.class);
+      createWeldLib(ear, "/weld/mcandweld/weld", SimpleWebBean.class);
+      
+      Deployment deployment = createVFSDeployment(ear);
+      String installerName = deployment.getName() + "BootstrapBeanInstaller=SimpleBean";
+
+      mainDeployer.addDeployment(deployment);
+      mainDeployer.process();
+      try
+      {
+         DeploymentUnit earDU = getMainDeployerStructure().getDeploymentUnit(deployment.getName());
+
+         //Check that the flat deployment bean has been started
+         FlatDeployment flatDeployment = (FlatDeployment)getBean(DeployersUtils.getDeploymentBeanName(earDU));
+         assertNotNull(flatDeployment);
+
+         //Check that the simple bean installer has been created
+         ControllerContext ctx = getControllerContext(installerName,  null);
+         assertNotNull(ctx);
+         //Check the simple bean itself has not been created
+         assertNoControllerContext("SimpleBean", null);
+      }
+      finally
+      {
+         getLog().debug("============== Undeploying everything");
+         mainDeployer.removeDeployment(deployment);
+         mainDeployer.process();
+      }
+      assertNoControllerContext(installerName, null);
+      assertNoControllerContext("SimpleBean", null);
+   }
+   
+
+
+}
\ No newline at end of file

Added: projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/test/McIntegrationTestCase.java
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/test/McIntegrationTestCase.java	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/java/org/jboss/test/deployers/test/McIntegrationTestCase.java	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,384 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.deployers.test;
+
+import java.lang.reflect.Method;
+
+import javax.enterprise.inject.spi.BeanManager;
+
+import junit.framework.Test;
+
+import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.deployers.client.spi.DeployerClient;
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.kernel.weld.plugins.dependency.WeldKernelControllerContext;
+import org.jboss.test.deployers.support.mcandweld.bidirectional.end.First;
+import org.jboss.test.deployers.support.mcandweld.bidirectional.end.Last;
+import org.jboss.test.deployers.support.mcandweld.bidirectional.middle.Middle;
+import org.jboss.test.deployers.support.mcandweld.mc.fromweld.McBeanWithInjectedWeldBean;
+import org.jboss.test.deployers.support.mcandweld.mc.simple.SimpleBean;
+import org.jboss.test.deployers.support.mcandweld.weld.frommc.WeldBeanWithInjectedMcBean;
+import org.jboss.test.deployers.support.mcandweld.weld.simple.SimpleWebBean;
+import org.jboss.virtual.AssembledDirectory;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.weld.integration.deployer.DeployersUtils;
+import org.jboss.weld.integration.deployer.env.FlatDeployment;
+
+/**
+ * Test weld and mc injection with the weld bootstrap bean set up properly 
+ *
+ * @author <a href="mailto:kabir.khan at jboss.com">Kabir Khan</a>
+ */
+public class McIntegrationTestCase extends AbstractWeldTest
+{
+   public McIntegrationTestCase(String name)
+   {
+      super(name);
+   }
+
+   public static Test suite()
+   {
+      return suite(McIntegrationTestCase.class);
+   }
+
+   public void testMcDeployment() throws Exception
+   {
+      AssembledDirectory top = createAssembledDirectory("top-level.ear", "top-level.ear");
+      addPath(top, "/weld/mcandweld/ear/mconly", "META-INF");
+      createMcLib(top, "/weld/mcandweld/mc/simple", SimpleBean.class);
+      
+      Deployment deployment = createVFSDeployment(top);
+      DeployerClient mainDeployer = getDeployerClient();
+      mainDeployer.addDeployment(deployment);
+      mainDeployer.process();
+      try
+      {
+         Object o = getBean("SimpleBean");
+         assertNotNull(o);
+      }
+      finally
+      {
+         mainDeployer.removeDeployment(deployment);
+         mainDeployer.process();
+      }
+   }
+   
+   public void testWeldDeployment() throws Exception
+   {
+      AssembledDirectory top = createAssembledDirectory("top-level.ear", "top-level.ear");
+      addPath(top, "/weld/mcandweld/ear/weldonly", "META-INF");
+      createWeldLib(top, "/weld/mcandweld/weld", SimpleWebBean.class);
+      
+      testBootstrap(top, new RunSpecificTest()
+      {
+         public void runTest(BeanManager manager, DeploymentUnit unit) throws Exception
+         {
+            assertWebBean(manager, unit, SimpleWebBean.class.getName());
+         }
+      });
+   }
+
+   public void testWeldAndMcDeployment() throws Exception
+   {
+      AssembledDirectory top = createAssembledDirectory("top-level.ear", "top-level.ear");
+      addPath(top, "/weld/mcandweld/ear/weldandmc", "META-INF");
+      createMcLib(top, "/weld/mcandweld/mc/simple", SimpleBean.class);
+      createWeldLib(top, "/weld/mcandweld/weld", SimpleWebBean.class);
+
+      testBootstrap(top, new RunSpecificTest()
+      {
+         public void runTest(BeanManager manager, DeploymentUnit unit) throws Exception
+         {
+            assertInstanceOf(getControllerContext("SimpleBean"), WeldKernelControllerContext.class);
+            Object o = getBean("SimpleBean");
+            assertNotNull(o);
+            assertWebBean(manager, unit, SimpleWebBean.class.getName());
+            assertNoWebBean(manager, unit, SimpleBean.class.getName());
+         }
+      });
+      assertNoControllerContext("SimpleBean", null);
+   }
+   
+   public void testMcInjectedByWeld() throws Exception
+   {
+      AssembledDirectory top = createAssembledDirectory("top-level.ear", "top-level.ear");
+      addPath(top, "/weld/mcandweld/ear/weldandmc", "META-INF");
+      createMcLib(top, "/weld/mcandweld/mc/fromweld", McBeanWithInjectedWeldBean.class);
+      createWeldLib(top, "/weld/mcandweld/weld", SimpleWebBean.class);
+
+      testBootstrap(top, new RunSpecificTest()
+      {
+         public void runTest(BeanManager manager, DeploymentUnit unit) throws Exception
+         {
+            Object mc = getBean("McBean");
+            assertNotNull(mc);
+            Object weldBean = assertWebBean(manager, unit, SimpleWebBean.class.getName());
+            assertNoWebBean(manager, unit, McBeanWithInjectedWeldBean.class.getName());
+            
+            Method m = mc.getClass().getMethod("getSimpleWebBean");
+            Object injectedWeldBean = m.invoke(mc);
+            assertNotNull(injectedWeldBean);
+            assertSame(weldBean.getClass(), injectedWeldBean.getClass());
+         }
+      });
+   }
+
+   public void testWeldInjectedByMc() throws Exception
+   {
+      AssembledDirectory top = createAssembledDirectory("top-level.ear", "top-level.ear");
+      addPath(top, "/weld/mcandweld/ear/weldandmc", "META-INF");
+      createMcLib(top, "/weld/mcandweld/mc/simple", SimpleBean.class);
+      createWeldLib(top, "/weld/mcandweld/weld", WeldBeanWithInjectedMcBean.class);
+      
+      testBootstrap(top, new RunSpecificTest()
+      {
+         public void runTest(BeanManager manager, DeploymentUnit unit) throws Exception
+         {
+            Object mc = getBean("SimpleBean");
+            assertNotNull(mc);
+            Object weldBean = assertWebBean(manager, unit, WeldBeanWithInjectedMcBean.class.getName());
+            assertSame(mc, assertWebBean(manager, unit, mc));
+
+            Method m = weldBean.getClass().getMethod("getSimpleBean");
+            Object injectedBean = m.invoke(weldBean);
+            assertNotNull(injectedBean);
+            assertSame(mc, injectedBean);
+         }
+      });
+   }
+
+   public void testMcInjectedIntoWeldInjectedIntoMc() throws Exception
+   {
+      AssembledDirectory top = createAssembledDirectory("top-level.ear", "top-level.ear");
+      addPath(top, "/weld/mcandweld/bidirectional", "META-INF");
+      createMcLib(top, "/weld/mcandweld/bidirectional/mc/end", First.class);
+      createWeldLib(top, "/weld/mcandweld/weld", Middle.class);
+      
+      testBootstrap(top, new RunSpecificTest()
+      {
+         public void runTest(BeanManager manager, DeploymentUnit unit) throws Exception
+         {
+            Object first = getBean("First");
+            assertNotNull(first);
+            Object middle = assertWebBean(manager, unit, Middle.class.getName());
+            Object last = getBean("Last");
+
+            Method getLast = middle.getClass().getMethod("getLast");
+            Object injectedLast = getLast.invoke(middle);
+            assertNotNull(injectedLast);
+            assertSame(last, injectedLast);
+            assertSame(last, assertWebBean(manager, unit, last));
+            
+            Method getMiddle = first.getClass().getMethod("getMiddle");
+            Object injectedMiddle = getMiddle.invoke(first);
+            assertNotNull(injectedMiddle);
+
+            assertSame(first, assertWebBean(manager, unit, first));
+         }
+      });
+   }
+   
+   public void testWeldInjectedIntoMcInjectedIntoWeld() throws Exception
+   {
+      AssembledDirectory top = createAssembledDirectory("top-level.ear", "top-level.ear");
+      addPath(top, "/weld/mcandweld/bidirectional", "META-INF");
+      createMcLib(top, "/weld/mcandweld/bidirectional/mc/middle", Middle.class);
+      createWeldLib(top, "/weld/mcandweld/weld", First.class);
+      
+      testBootstrap(top, new RunSpecificTest()
+      {
+         public void runTest(BeanManager manager, DeploymentUnit unit) throws Exception
+         {
+            Object first = assertWebBean(manager, unit, First.class.getName());
+            assertNotNull(first);
+            Object middle = getBean("Middle");
+            assertNotNull(middle);
+            assertWebBean(manager, unit, Last.class.getName());
+
+            Method getLast = middle.getClass().getMethod("getLast");
+            Object injectedLast = getLast.invoke(middle);
+            assertNotNull(injectedLast);
+            
+            Method getMiddle = first.getClass().getMethod("getMiddle");
+            Object injectedMiddle = getMiddle.invoke(first);
+            assertNotNull(injectedMiddle);
+            assertSame(middle, injectedMiddle);
+            assertSame(middle, assertWebBean(manager, unit, middle));
+         }
+      });
+   }
+   
+   public void testExternalMcBeanInjectedIntoWeld() throws Exception
+   {
+      AssembledDirectory mcEar = createAssembledDirectory("mc.ear", "mc.ear");
+      addPath(mcEar, "/weld/mcandweld/ear/mconly", "META-INF");
+      createMcLib(mcEar, "/weld/mcandweld/mc/simple", SimpleBean.class);
+      Deployment mc = deploy(mcEar);
+      
+      try
+      {
+         AssembledDirectory weldEar = createAssembledDirectory("weld.ear", "weld.ear");
+         addPath(weldEar, "/weld/mcandweld/ear/weldonly", "META-INF");
+         createWeldLib(weldEar, "/weld/mcandweld/weld", WeldBeanWithInjectedMcBean.class);
+         
+         testBootstrap(weldEar, new RunSpecificTest()
+         {
+            public void runTest(BeanManager manager, DeploymentUnit unit) throws Exception
+            {
+               Object mc = getBean("SimpleBean");
+               assertNotNull(mc);
+               Object weldBean = assertWebBean(manager, unit, WeldBeanWithInjectedMcBean.class.getName());
+               assertSame(mc, assertWebBean(manager, unit, mc));
+
+               Method m = weldBean.getClass().getMethod("getSimpleBean");
+               Object injectedBean = m.invoke(weldBean);
+               assertNotNull(injectedBean);
+               assertSame(mc, injectedBean);
+            }
+         });
+      }
+      finally
+      {
+         undeploy(mc);
+      }
+   }
+   
+   public void testExternalMcBeanInjectedIntoWeld2() throws Exception
+   {
+      AssembledDirectory mcEar = createAssembledDirectory("mc.ear", "mc.ear");
+      addPath(mcEar, "/weld/mcandweld/ear/mconly", "META-INF");
+      createMcLib(mcEar, "/weld/mcandweld/mc/simple", SimpleBean.class);
+      Deployment mc = deploy(mcEar);
+      
+      undeploy(mc);
+      
+      AssembledDirectory weldEar = createAssembledDirectory("weld.ear", "weld.ear");
+      addPath(weldEar, "/weld/mcandweld/ear/weldonly", "META-INF");
+      createWeldLib(weldEar, "/weld/mcandweld/weld", WeldBeanWithInjectedMcBean.class);
+      
+      try
+      {
+         testBootstrap(weldEar, null);
+         fail("Weld deployment should not have worked without mc deployment");
+      }
+      catch(Exception expected)
+      {
+      }
+      
+      mc = deploy(mcEar);
+      try
+      {
+         testBootstrap(weldEar, new RunSpecificTest()
+         {
+            public void runTest(BeanManager manager, DeploymentUnit unit) throws Exception
+            {
+               Object mc = getBean("SimpleBean");
+               assertNotNull(mc);
+               Object weldBean = assertWebBean(manager, unit, WeldBeanWithInjectedMcBean.class.getName());
+               assertSame(mc, assertWebBean(manager, unit, mc));
+
+               Method m = weldBean.getClass().getMethod("getSimpleBean");
+               Object injectedBean = m.invoke(weldBean);
+               assertNotNull(injectedBean);
+               assertSame(mc, injectedBean);
+            }
+         });
+      }
+      finally
+      {
+         undeploy(mc);
+      }
+   }
+   
+   protected void testBootstrap(VirtualFile ear, RunSpecificTest test) throws Exception
+   {
+      Deployment deployment = deploy(ear);
+      try
+      {
+         DeploymentUnit earDU = getMainDeployerStructure().getDeploymentUnit(deployment.getName());
+
+         //Check that the flat deployment bean has been started
+         FlatDeployment flatDeployment = (FlatDeployment)getBean(DeployersUtils.getDeploymentBeanName(earDU));
+         assertNotNull(flatDeployment);
+
+         String bootName = DeployersUtils.getBootstrapBeanName(earDU);
+
+         ControllerContext context = getControllerContext(bootName, null);
+         outputContext(context);
+         
+         //Check the bootstrap bean has been created
+         assertNotNull(getControllerContext(DeployersUtils.getBootstrapBeanName(earDU), ControllerState.CREATE));
+         
+         // install ejb
+         KernelControllerContext ejb = deploy(new AbstractBeanMetaData("EjbContainer#1", Object.class.getName()));
+         try
+         {
+            assertTrue(ejb.getState().equals(ControllerState.INSTALLED));
+            //Check the bootstrap bean has been installed
+            assertNotNull(getControllerContext(DeployersUtils.getBootstrapBeanName(earDU)));
+
+            BeanManager manager = getBeanManager(earDU);
+            
+            if (test != null)
+               test.runTest(manager, earDU);
+            
+         }
+         finally
+         {
+            undeploy(ejb);
+         }
+      }
+      finally
+      {
+         getDeployerClient().removeDeployment(deployment);
+         getDeployerClient().process();
+      }
+   }
+
+   protected Deployment deploy(VirtualFile ear) throws Exception
+   {
+      Deployment deployment = createVFSDeployment(ear);
+      
+      DeployerClient mainDeployer = getDeployerClient();
+      mainDeployer.addDeployment(deployment);
+      mainDeployer.process();
+      return deployment;
+   }
+   
+   protected void undeploy(Deployment deployment) throws Exception
+   {
+      DeployerClient mainDeployer = getDeployerClient();
+      mainDeployer.removeDeployment(deployment);
+      mainDeployer.process();
+      
+   }
+
+   interface RunSpecificTest
+   {
+      void runTest(BeanManager manager, DeploymentUnit unit) throws Exception;
+   }   
+
+}
\ No newline at end of file

Added: projects/weld-int/trunk/deployer-mc-int/src/test/resources/org/jboss/test/deployers/test/McIntegrationNoBootstrapBeanTestCase.xml
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/resources/org/jboss/test/deployers/test/McIntegrationNoBootstrapBeanTestCase.xml	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/resources/org/jboss/test/deployers/test/McIntegrationNoBootstrapBeanTestCase.xml	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,46 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+  <bean name="EarStructure" class="org.jboss.test.deployers.vfs.structure.ear.support.MockEarStructureDeployer"/>
+  <bean name="WarStructure" class="org.jboss.test.deployers.vfs.structure.war.support.MockWarStructureDeployer"/>
+
+  <bean name="JWBMDDeployer" class="org.jboss.weld.integration.deployer.ext.JBossWeldMetaDataDeployer"/>
+  <bean name="WBFilesDeployer" class="org.jboss.weld.integration.deployer.metadata.WeldFilesDeployer"/>
+  <bean name="WBDiscoveryDeployer" class="org.jboss.weld.integration.deployer.env.WeldDiscoveryDeployer"/>
+
+  <bean name="DynamicDependencyCreator" class="org.jboss.weld.integration.deployer.env.DynamicDependencyCreator">
+    <constructor>
+      <parameter><inject bean="jboss.kernel:service=KernelController"/></parameter>
+    </constructor>
+  </bean>
+
+  <bean name="JBWMDDeployer" class="org.jboss.test.deployers.support.deployer.MockWebDeployer"/>
+  <bean name="WarCLDeployer" class="org.jboss.test.deployers.support.deployer.MockWarClassLoaderDeployer"/>
+  <bean name="MockUrlIntDeployer" class="org.jboss.test.deployers.support.deployer.MockCoreIntegrationDeployer"/>
+
+  <bean name="MockValidatorFactoryDeployer" class="org.jboss.test.deployers.support.deployer.MockValidatorFactoryDeployer"/>
+  
+  <beanfactory name="JBossJpaServices" class="org.jboss.test.deployers.support.MockJBossJpaServices"/>
+  
+  <bean name="EjbServicesDeployer" class="org.jboss.weld.integration.deployer.env.EjbServicesDeployer">
+    <property name="ejbServicesClassName">org.jboss.test.deployers.support.MockEjbServices</property>
+  </bean>
+
+  <bean name="DeploymentDeployer" class="org.jboss.weld.integration.deployer.env.FlatDeploymentDeployer"/>
+
+  <bean name="BootDeployer" class="org.jboss.test.deployers.support.deployer.MockBootDeployer"/>
+  
+  <bean name="WeldBeanMetaDataDeployerPlugin" class="org.jboss.weld.integration.deployer.mc.WeldBeanMetaDataDeployerPlugin"/>
+  
+  <bean name="JBossSecurityServices" class="org.jboss.weld.integration.security.JBossSecurityServices"/>
+   
+  <bean name="JBossResourceServices" class="org.jboss.weld.integration.resource.JBossResourceServices"/> 
+
+  <!-- Mock EJB utils -->
+
+  <beanfactory name="JBossEjbServices" class="org.jboss.test.deployers.support.MockEjbServices"/>
+
+  <bean name="JBossTransactionServices" class="org.jboss.test.deployers.support.MockTransactionServices"/>
+
+  <bean name="RealTransactionManager" class="java.lang.Object"/>
+
+</deployment>

Added: projects/weld-int/trunk/deployer-mc-int/src/test/resources/org/jboss/test/deployers/test/McIntegrationTestCase.xml
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/resources/org/jboss/test/deployers/test/McIntegrationTestCase.xml	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/resources/org/jboss/test/deployers/test/McIntegrationTestCase.xml	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,46 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+  <bean name="EarStructure" class="org.jboss.test.deployers.vfs.structure.ear.support.MockEarStructureDeployer"/>
+  <bean name="WarStructure" class="org.jboss.test.deployers.vfs.structure.war.support.MockWarStructureDeployer"/>
+
+  <bean name="JWBMDDeployer" class="org.jboss.weld.integration.deployer.ext.JBossWeldMetaDataDeployer"/>
+  <bean name="WBFilesDeployer" class="org.jboss.weld.integration.deployer.metadata.WeldFilesDeployer"/>
+  <bean name="WBDiscoveryDeployer" class="org.jboss.weld.integration.deployer.env.WeldDiscoveryDeployer"/>
+
+  <bean name="DynamicDependencyCreator" class="org.jboss.weld.integration.deployer.env.DynamicDependencyCreator">
+    <constructor>
+      <parameter><inject bean="jboss.kernel:service=KernelController"/></parameter>
+    </constructor>
+  </bean>
+
+  <bean name="JBWMDDeployer" class="org.jboss.test.deployers.support.deployer.MockWebDeployer"/>
+  <bean name="WarCLDeployer" class="org.jboss.test.deployers.support.deployer.MockWarClassLoaderDeployer"/>
+  <bean name="MockUrlIntDeployer" class="org.jboss.test.deployers.support.deployer.MockCoreIntegrationDeployer"/>
+
+  <bean name="MockValidatorFactoryDeployer" class="org.jboss.test.deployers.support.deployer.MockValidatorFactoryDeployer"/>
+  
+  <beanfactory name="JBossJpaServices" class="org.jboss.test.deployers.support.MockJBossJpaServices"/>
+  
+  <bean name="EjbServicesDeployer" class="org.jboss.weld.integration.deployer.env.EjbServicesDeployer">
+    <property name="ejbServicesClassName">org.jboss.test.deployers.support.MockEjbServices</property>
+  </bean>
+
+  <bean name="DeploymentDeployer" class="org.jboss.weld.integration.deployer.env.FlatDeploymentDeployer"/>
+
+  <bean name="WeldBootstrapDeployer" class="org.jboss.weld.integration.deployer.env.WeldBootstrapDeployer"/>
+  
+  <bean name="WeldBeanMetaDataDeployerPlugin" class="org.jboss.weld.integration.deployer.mc.WeldBeanMetaDataDeployerPlugin"/>
+  
+  <bean name="JBossSecurityServices" class="org.jboss.weld.integration.security.JBossSecurityServices"/>
+   
+  <bean name="JBossResourceServices" class="org.jboss.weld.integration.resource.JBossResourceServices"/> 
+
+  <!-- Mock EJB utils -->
+
+  <beanfactory name="JBossEjbServices" class="org.jboss.test.deployers.support.MockEjbServices"/>
+
+  <bean name="JBossTransactionServices" class="org.jboss.test.deployers.support.MockTransactionServices"/>
+
+  <bean name="RealTransactionManager" class="java.lang.Object"/>
+
+</deployment>

Added: projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/META-INF/MANIFEST.MF
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/META-INF/MANIFEST.MF	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/META-INF/MANIFEST.MF	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+Created-By: hand

Added: projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/META-INF/application.properties
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/META-INF/application.properties	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/META-INF/application.properties	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,2 @@
+jar1-module=weld.jar
+jar2-module=mc.jar
\ No newline at end of file

Added: projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/mc/end/META-INF/MANIFEST.MF
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/mc/end/META-INF/MANIFEST.MF	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/mc/end/META-INF/MANIFEST.MF	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+Created-By: hand

Added: projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/mc/end/META-INF/end-beans.xml
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/mc/end/META-INF/end-beans.xml	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/mc/end/META-INF/end-beans.xml	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,8 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+  <bean name="First" class="org.jboss.test.deployers.support.mcandweld.bidirectional.end.First">
+    <annotation>@org.jboss.kernel.weld.metadata.api.annotations.WeldEnabled</annotation>
+   </bean>
+  <bean name="Last" class="org.jboss.test.deployers.support.mcandweld.bidirectional.end.Last">
+    <annotation>@org.jboss.kernel.weld.metadata.api.annotations.WeldEnabled</annotation>
+   </bean>
+</deployment>
\ No newline at end of file

Added: projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/mc/middle/META-INF/MANIFEST.MF
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/mc/middle/META-INF/MANIFEST.MF	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/mc/middle/META-INF/MANIFEST.MF	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+Created-By: hand

Added: projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/mc/middle/META-INF/middle-beans.xml
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/mc/middle/META-INF/middle-beans.xml	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/bidirectional/mc/middle/META-INF/middle-beans.xml	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,5 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+  <bean name="Middle" class="org.jboss.test.deployers.support.mcandweld.bidirectional.middle.Middle">
+    <annotation>@org.jboss.kernel.weld.metadata.api.annotations.WeldEnabled</annotation>
+   </bean>
+</deployment>
\ No newline at end of file

Added: projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/mconly/META-INF/MANIFEST.MF
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/mconly/META-INF/MANIFEST.MF	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/mconly/META-INF/MANIFEST.MF	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+Created-By: hand

Added: projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/mconly/META-INF/application.properties
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/mconly/META-INF/application.properties	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/mconly/META-INF/application.properties	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1 @@
+jar-module=mc.jar

Added: projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/weldandmc/META-INF/MANIFEST.MF
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/weldandmc/META-INF/MANIFEST.MF	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/weldandmc/META-INF/MANIFEST.MF	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+Created-By: hand

Added: projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/weldandmc/META-INF/application.properties
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/weldandmc/META-INF/application.properties	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/weldandmc/META-INF/application.properties	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,2 @@
+jar1-module=weld.jar
+jar2-module=mc.jar
\ No newline at end of file

Added: projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/weldonly/META-INF/MANIFEST.MF
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/weldonly/META-INF/MANIFEST.MF	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/weldonly/META-INF/MANIFEST.MF	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+Created-By: hand

Added: projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/weldonly/META-INF/application.properties
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/weldonly/META-INF/application.properties	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/ear/weldonly/META-INF/application.properties	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1 @@
+jar-module=weld.jar

Added: projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/mc/fromweld/META-INF/MANIFEST.MF
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/mc/fromweld/META-INF/MANIFEST.MF	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/mc/fromweld/META-INF/MANIFEST.MF	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+Created-By: hand

Added: projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/mc/fromweld/META-INF/fromweld-beans.xml
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/mc/fromweld/META-INF/fromweld-beans.xml	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/mc/fromweld/META-INF/fromweld-beans.xml	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,3 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+  <bean name="McBean" class="org.jboss.test.deployers.support.mcandweld.mc.fromweld.McBeanWithInjectedWeldBean"/>
+</deployment>
\ No newline at end of file

Added: projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/mc/simple/META-INF/MANIFEST.MF
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/mc/simple/META-INF/MANIFEST.MF	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/mc/simple/META-INF/MANIFEST.MF	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+Created-By: hand

Added: projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/mc/simple/META-INF/simple-beans.xml
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/mc/simple/META-INF/simple-beans.xml	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/mc/simple/META-INF/simple-beans.xml	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,3 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+  <bean name="SimpleBean" class="org.jboss.test.deployers.support.mcandweld.mc.simple.SimpleBean"/>
+</deployment>
\ No newline at end of file

Added: projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/weld/META-INF/MANIFEST.MF
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/weld/META-INF/MANIFEST.MF	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/weld/META-INF/MANIFEST.MF	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+Created-By: hand

Added: projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/weld/META-INF/beans.xml
===================================================================
--- projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/weld/META-INF/beans.xml	                        (rev 0)
+++ projects/weld-int/trunk/deployer-mc-int/src/test/resources/weld/mcandweld/weld/META-INF/beans.xml	2009-11-11 14:42:04 UTC (rev 96258)
@@ -0,0 +1,2 @@
+<web-beans>  
+</web-beans>
\ No newline at end of file

Modified: projects/weld-int/trunk/pom.xml
===================================================================
--- projects/weld-int/trunk/pom.xml	2009-11-11 14:11:52 UTC (rev 96257)
+++ projects/weld-int/trunk/pom.xml	2009-11-11 14:42:04 UTC (rev 96258)
@@ -20,11 +20,11 @@
       <module>ejb</module>
       <module>webtier</module>
       <module>deployer</module>
+      <module>deployer-mc-int</module>
       <module>assembly</module>
    </modules>
 
    <properties>
-
       <version.weld>1.0.0</version.weld>
       <version.jboss.interceptor>1.0.0-CR8</version.jboss.interceptor>
       <version.jboss.vfs>2.1.2.GA</version.jboss.vfs>
@@ -52,6 +52,7 @@
       <version.jbossts>4.6.1.GA</version.jbossts>
       <version.faces>2.0.0-RC</version.faces>
       <version.interceptor.api>1.1-CR1</version.interceptor.api>
+      <version.slf4j>1.5.9.RC1</version.slf4j>
    </properties>
 
    <build>
@@ -408,6 +409,12 @@
          </dependency>
 
          <dependency>
+            <groupId>org.jboss.weld.integration</groupId>
+            <artifactId>weld-jboss-int-deployer-mc-int</artifactId>
+            <version>${project.version}</version>
+         </dependency>
+
+         <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>servlet-api</artifactId>
             <version>${version.servlet.api}</version>




More information about the jboss-cvs-commits mailing list