[jboss-cvs] JBossAS SVN: r105413 - in projects/weld-int/branches/Deployment_WELDINT-1/deployer/src: main/java/org/jboss/weld/integration/deployer/env/bda and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon May 31 10:16:24 EDT 2010


Author: flavia.rainone at jboss.com
Date: 2010-05-31 10:16:23 -0400 (Mon, 31 May 2010)
New Revision: 105413

Added:
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/ArchiveDiscoveryDeployer.java
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/ArchiveInfoDeployer.java
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/JBossDeploymentDeployer.java
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/Archive.java
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/ArchiveCollection.java
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/ArchiveFactory.java
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/ArchiveInfo.java
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/ArchiveToClasspath.java
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/BDALifecycleListener.java
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/BeanDeploymentArchiveImpl.java
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/Classpath.java
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/ClasspathFactory.java
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/ClasspathImpl.java
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/DeploymentImpl.java
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/NoDuplicatesClasspath.java
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/SecurityActions.java
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/ArchiveDiscoveryDeploymentTestCase.java
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/ArchiveInfoDeploymentTestCase.java
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/FlatDeploymentSmokeTestCase.java
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/JBossDeploymentSmokeTestCase.java
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/JBossDeploymentTestCase.java
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/resources/org/jboss/test/deployers/test/ArchiveDiscoveryDeploymentTestCase.xml
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/resources/org/jboss/test/deployers/test/ArchiveInfoDeploymentTestCase.xml
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/resources/org/jboss/test/deployers/test/FlatDeploymentSmokeTestCase.xml
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/resources/org/jboss/test/deployers/test/JBossDeploymentSmokeTestCase.xml
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/resources/org/jboss/test/deployers/test/JBossDeploymentTestCase.xml
Removed:
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/resources/org/jboss/test/deployers/test/SmokeTestCase.xml
Modified:
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/VFSTestSuite.java
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/AbstractDeploymentTest.java
   projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/SmokeTestCase.java
Log:
[WELDINT-1] Draft implementation.

Added: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/ArchiveDiscoveryDeployer.java
===================================================================
--- projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/ArchiveDiscoveryDeployer.java	                        (rev 0)
+++ projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/ArchiveDiscoveryDeployer.java	2010-05-31 14:16:23 UTC (rev 105413)
@@ -0,0 +1,145 @@
+/*
+ * 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.weld.integration.deployer.env;
+
+import java.net.URL;
+import java.util.Collection;
+
+import org.jboss.classloading.spi.dependency.Module;
+import org.jboss.classloading.spi.visitor.ClassFilter;
+import org.jboss.classloading.spi.visitor.ResourceContext;
+import org.jboss.classloading.spi.visitor.ResourceFilter;
+import org.jboss.classloading.spi.visitor.ResourceVisitor;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.vfs.spi.deployer.AbstractOptionalVFSRealDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.util.NotImplementedException;
+import org.jboss.vfs.VirtualFile;
+import org.jboss.weld.integration.deployer.DeployersUtils;
+import org.jboss.weld.integration.deployer.env.bda.ArchiveInfo;
+import org.jboss.weld.integration.deployer.ext.JBossWeldMetaData;
+
+/**
+ * ArchiveDiscovery deployer.
+ * Deploys information into ArchiveInfo's environment.
+ * 
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ * @author <a href="mailto:flavia.rainone at jboss.com">Flavia Rainone</a>
+ */
+public class ArchiveDiscoveryDeployer extends AbstractOptionalVFSRealDeployer<JBossWeldMetaData>
+{
+   public ArchiveDiscoveryDeployer()
+   {
+      super(JBossWeldMetaData.class);
+      addInput(DeployersUtils.WELD_FILES);
+      addInput(DeployersUtils.WELD_CLASSPATH);
+      addInput(ArchiveInfo.class);
+      addOutput(ArchiveInfo.class);
+      setStage(DeploymentStages.PRE_REAL);
+   }
+
+   public void deploy(VFSDeploymentUnit unit, JBossWeldMetaData deployment) throws DeploymentException
+   {
+      @SuppressWarnings("unchecked")
+      Collection<VirtualFile> wbFiles = unit.getAttachment(DeployersUtils.WELD_FILES, Collection.class);
+      boolean hasWB = (wbFiles != null && wbFiles.isEmpty() == false);
+
+      @SuppressWarnings("unchecked")
+      Collection<VirtualFile> cpFiles = unit.getAttachment(DeployersUtils.WELD_CLASSPATH, Collection.class);
+      boolean hasCp = (cpFiles != null && cpFiles.isEmpty() == false);
+
+      if (!hasWB && !hasCp)
+      {
+         return;
+      }
+      
+      try
+      {
+         ArchiveInfo archive = null;
+         if (hasCp)
+         {
+            VFSDeploymentUnit moduleUnit = unit;
+            Module module = moduleUnit.getAttachment(Module.class);
+            while (moduleUnit != null && module == null)
+            {
+               moduleUnit = moduleUnit.getParent();
+               module = moduleUnit.getAttachment(Module.class);
+            }
+            if (module == null)
+               throw new DeploymentException("No module in deployment unit's hierarchy: " + unit.getName());
+
+            URL[] urls = new URL[cpFiles.size()];
+            int i = 0;
+            for (VirtualFile file : cpFiles)
+            {
+               urls[i++] = file.toURL();
+            }
+            
+            archive = moduleUnit.getAttachment(ArchiveInfo.class);
+            if (archive == null)
+            {
+               throw new IllegalStateException("Archive attachment expected for unit " + unit);
+            }
+            WeldDiscoveryEnvironment environment = archive.getEnvironment();
+            WBDiscoveryVisitor visitor = new WBDiscoveryVisitor(environment);
+            module.visit(visitor, ClassFilter.INSTANCE, null, urls);
+            if (hasWB)
+            {
+               for (VirtualFile file : wbFiles)
+                  environment.addWeldXmlURL(file.toURL());
+               
+            }
+         }
+         else if (hasWB)
+         {
+            // FIXME
+            throw new NotImplementedException();
+         }
+      }
+      catch (Exception e)
+      {
+         throw DeploymentException.rethrowAsDeploymentException("Cannot build WB env.", e);
+      }
+   }
+
+   
+   private static class WBDiscoveryVisitor implements ResourceVisitor
+   {
+      private WeldDiscoveryEnvironment wbdi;
+
+      private WBDiscoveryVisitor(WeldDiscoveryEnvironment wbdi)
+      {
+         this.wbdi = wbdi;
+      }
+
+      public ResourceFilter getFilter()
+      {
+         return ClassFilter.INSTANCE;
+      }
+
+      public void visit(ResourceContext resource)
+      {
+         wbdi.addWeldClass(resource.loadClass());
+      }
+   }
+}
\ No newline at end of file


Property changes on: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/ArchiveDiscoveryDeployer.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/ArchiveInfoDeployer.java
===================================================================
--- projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/ArchiveInfoDeployer.java	                        (rev 0)
+++ projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/ArchiveInfoDeployer.java	2010-05-31 14:16:23 UTC (rev 105413)
@@ -0,0 +1,62 @@
+/*
+ * 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.weld.integration.deployer.env;
+
+import org.jboss.classloading.spi.RealClassLoader;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.vfs.spi.deployer.AbstractOptionalVFSRealDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.util.NotImplementedException;
+import org.jboss.weld.integration.deployer.env.bda.ArchiveInfo;
+import org.jboss.weld.integration.deployer.ext.JBossWeldMetaData;
+
+/**
+ * ArchiveInfo deployer.
+ *
+ * @author <a href="mailto:flavia.rainone at jboss.com">Flavia Rainone</a>
+ */
+public class ArchiveInfoDeployer extends AbstractOptionalVFSRealDeployer<JBossWeldMetaData>
+{
+   public ArchiveInfoDeployer()
+   {
+      super(JBossWeldMetaData.class);
+      addOutput(ArchiveInfo.class);
+      setStage(DeploymentStages.POST_CLASSLOADER);
+   }
+
+   public void deploy(VFSDeploymentUnit unit, JBossWeldMetaData deployment) throws DeploymentException
+   {
+      ClassLoader classLoader = unit.getClassLoader();
+      if (!unit.isTopLevel() && unit.getParent().getClassLoader() == classLoader)
+      {
+         return;
+      }
+      if (classLoader instanceof RealClassLoader)
+      {
+         unit.addAttachment(ArchiveInfo.class, new ArchiveInfo(classLoader));
+      }
+      else
+         // FIXME
+         throw new NotImplementedException();
+   }
+}
\ No newline at end of file


Property changes on: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/ArchiveInfoDeployer.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/JBossDeploymentDeployer.java
===================================================================
--- projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/JBossDeploymentDeployer.java	                        (rev 0)
+++ projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/JBossDeploymentDeployer.java	2010-05-31 14:16:23 UTC (rev 105413)
@@ -0,0 +1,85 @@
+/*
+ * 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.weld.integration.deployer.env;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.weld.bootstrap.spi.Deployment;
+import org.jboss.weld.integration.deployer.env.bda.ArchiveInfo;
+import org.jboss.weld.integration.deployer.env.bda.DeploymentImpl;
+
+/**
+ * JBoss Deployment Deployer.
+ * Creates metadata for creation of a Deployment.
+ *
+ * @author <a href="mailto:flavia.rainone at jboss.com">Flavia Rainone</a>
+ */
+public class JBossDeploymentDeployer extends AbstractDeploymentDeployer
+{
+   public JBossDeploymentDeployer()
+   {
+      super();
+      addInput(ArchiveInfo.class);
+   }
+
+   @Override
+   protected boolean isRelevant(DeploymentUnit unit)
+   {
+      return unit.isAttachmentPresent(ArchiveInfo.class);
+   }
+
+   protected Class<? extends Deployment> getDeploymentClass()
+   {
+      return DeploymentImpl.class;
+   }
+
+   protected void buildDeployment(DeploymentUnit unit, BootstrapInfo info, BeanMetaDataBuilder builder)
+   {
+      builder.addConstructorParameter(String.class.getName(), unit.getName());
+      builder.addConstructorParameter(Collection.class.getName(), getArchiveInfos(unit));
+      builder.addConstructorParameter(Collection.class.getName(), builder.createInject(info.getEjbServices().getUnderlyingValue(), "ejbs"));
+      builder.addUninstall("undeploy");
+   }
+   
+   private Collection<ArchiveInfo> getArchiveInfos(DeploymentUnit unit)
+   {
+      Collection<ArchiveInfo> archiveInfos = new ArrayList<ArchiveInfo>();
+      fill(archiveInfos, unit);
+      return archiveInfos;
+   }
+   
+   private void fill(Collection<ArchiveInfo> archiveInfos, DeploymentUnit unit)
+   {
+      ArchiveInfo archiveInfo = unit.getAttachment(ArchiveInfo.class);
+      if (archiveInfo != null)
+      {
+         archiveInfos.add(archiveInfo);
+      }
+      for (DeploymentUnit child: unit.getChildren())
+      {
+         fill(archiveInfos, child);
+      }
+   }
+}
\ No newline at end of file


Property changes on: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/JBossDeploymentDeployer.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/Archive.java
===================================================================
--- projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/Archive.java	                        (rev 0)
+++ projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/Archive.java	2010-05-31 14:16:23 UTC (rev 105413)
@@ -0,0 +1,225 @@
+/*
+ * 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.weld.integration.deployer.env.bda;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.weld.ejb.spi.EjbDescriptor;
+
+/**
+ * An archive is an abstract representation of one or more deployed archives.
+ * It mainly contains a list of classes and an optional list of bean.xml file URLs
+ * (only when those files are available).
+ * <br>
+ * Every archive can provide a corresponding BeanDeploymentArchive when requested. Notice
+ * that the provided BeanDeploymentArchive is simply a different view of the archive.
+ * <br>
+ * As for class loading related issues, every archive is associated with the class loader
+ * responsible for loading it during deployment and is also associated with a classpath.
+ * This classpath contains a list of all archives visible to an archive and is used for
+ * iterating over both the archive graph and the corresponding BeanDeploymentArchive graph.
+ * 
+ * @author <a href="mailto:flavia.rainone at jboss.com">Flavia Rainone</a>
+ * @version $Revision$
+ * @see Classpath
+ */
+class Archive
+{
+
+   // the classes contained in this archive
+   private final Collection<Class<?>> classes;
+
+   // the bean.xml URLs contained in this archive
+   private final Collection<URL> xmlURLs;
+
+   // the classloader that loaded this archive
+   private final ClassLoader classLoader;
+   
+   // the classpath of this archive
+   private final Classpath classpath;
+
+   // the bda view of this archive, if available
+   private BeanDeploymentArchive bda;
+
+   // the ejbs
+   private final Collection<EjbDescriptor<?>> ejbs;
+
+   // the list of all bdaLifecycleListeners
+   private final Collection<BDALifecycleListener> bdaLifecycleListeners;
+
+   /**
+    * Constructor. Can only be called by ArchiveFactory.
+    * 
+    * @param archiveInfo contains all information necessary for the initialization of this
+    *                    archive
+    * @param ejbs        the list of ejb descriptors
+    * @see ArchiveFactory#createArchive(ArchiveInfo, Collection)
+    */
+   public Archive(ArchiveInfo archiveInfo, Collection<EjbDescriptor<?>> ejbs)
+   {
+      this.classes = archiveInfo.getEnvironment().getWeldClasses();
+      this.xmlURLs = archiveInfo.getEnvironment().getWeldXml();
+      this.classLoader = archiveInfo.getClassLoader();
+      this.classpath = archiveInfo.getClasspath();
+      this.classpath.addArchive(this);
+      this.bdaLifecycleListeners = new ArrayList<BDALifecycleListener>();
+      this.ejbs = ejbs;
+   }
+
+   /**
+    * Returns all classes contained in this archive.
+    * 
+    * @return the classes contained in this archive
+    */
+   public Collection<Class<?>> getClasses()
+   {
+      return classes;
+   }
+
+   /**
+    * Indicates whether this archive contains the requested class.
+    * 
+    * @param beanClass a class that could be contained in this archive
+    * @return          {@code true} only if this archive contains {@code beanClass}
+    */
+   public boolean containsClass(Class<?> beanClass)
+   {
+      return beanClass.getClassLoader() == this.classLoader;
+   }
+
+   /**
+    * Returns the URLs of all bean.xml files contained in this archive.
+    * 
+    * @return the URLs of the bean.xml files
+    */
+   public Collection<URL> getXmlURLs()
+   {
+      return xmlURLs;
+   }
+
+   /**
+    * Indicates whether this archive has one or more bean.xml files
+    * 
+    * @return {@code true} if this archive contains a bean.xml file
+    */
+   public boolean hasXml()
+   {
+      return xmlURLs != null && !xmlURLs.isEmpty();
+   }
+
+   /**
+    * Returns the classloader that loaded this archive.
+    * 
+    * @return the classloader that loaded this archive
+    */
+   public ClassLoader getClassLoader()
+   {
+      return classLoader;
+   }
+
+   /**
+    * Returns the classpath of this archive, that contains all archives visible to this
+    * archive. This classpath can also be used to retrieve the bdas visible to the bda
+    * associated with this archive, when this bda is avaialble.
+    * 
+    * @return the classpath
+    */
+   public Classpath getClasspath()
+   {
+      return classpath;
+   }
+
+   /**
+    * Returns the BeanDeploymentArchive that corresponds to this archive.
+    * 
+    * @return the BeanDeploymentArchive representing this archive. May be {@code null} if
+    *         it has not been created
+    */
+   public BeanDeploymentArchive getBeanDeploymentArchive()
+   {
+      return bda;
+   }
+
+   /**
+    * Creates the BeanDeploymentArchive that corresponds to this archive. This method never
+    * returns duplicates.
+    * 
+    * @return the BeanDeploymentArchive representing this archive. If this bda has not
+    *         been created, it is created and returned
+    */
+   public BeanDeploymentArchive createBeanDeploymentArchive()
+   {
+      if (bda == null)
+      {
+         bda = new BeanDeploymentArchiveImpl(classLoader.toString(), this);
+         for (BDALifecycleListener listener: bdaLifecycleListeners)
+         {
+            listener.bdaCreated(bda);
+         }
+      }
+      return bda;
+   }
+
+   /**
+    * Adds a BDALifecycleListener. When called prior to BDA creation, this listener will
+    * be notified of the BDA creation. The listener will also be notified when the bda is
+    * destroyed (undeployment)
+    * 
+    * @param listener a BDALifecycleListener
+    */
+   public void addBDALifecycleListener(BDALifecycleListener listener)
+   {
+      this.bdaLifecycleListeners.add(listener);
+   }
+
+   /**
+    * Return the collection of EJBDescriptors.
+    * 
+    * @return the ejbs associated with this Archive
+    */
+   public Collection<EjbDescriptor<?>> getEjbs()
+   {
+      return ejbs;
+   }
+
+   /**
+    * Notifies this archive that it is being undeployed.
+    */
+   public void undeploy()
+   {
+      if (bda != null)
+      {
+         for (BDALifecycleListener listener: bdaLifecycleListeners)
+         {
+            listener.bdaDestroyed(bda);
+         }
+      }
+   }
+
+   public String toString()
+   {
+      return "Archive[" + classLoader + "]";
+   }
+}


Property changes on: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/Archive.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/ArchiveCollection.java
===================================================================
--- projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/ArchiveCollection.java	                        (rev 0)
+++ projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/ArchiveCollection.java	2010-05-31 14:16:23 UTC (rev 105413)
@@ -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.weld.integration.deployer.env.bda;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+
+/**
+ * A collection of archives.
+ * This collection contains not only the archives added to it, as it also contains
+ * an updated list of the bdas corresponding to those archives when available.
+ * 
+ * @author <a href="mailto:flavia.rainone at jboss.com">Flavia Rainone</a>
+ * @version $Revision$
+ */
+class ArchiveCollection implements BDALifecycleListener, Iterable<Archive>
+{
+   // the archives collection
+   protected Collection<Archive> archives = new ArrayList<Archive>();
+   
+   // the bdas collection
+   protected Collection<BeanDeploymentArchive> bdas = new ArrayList<BeanDeploymentArchive>();
+
+   /**
+    * Adds an archive to this collection.
+    * 
+    * @param archive the archive to be added
+    */
+   public synchronized void add(Archive archive)
+   {
+      archives.add(archive);
+      archive.addBDALifecycleListener(this);
+   }
+
+   /**
+    * For concurrent safe iteration, synchronize the iteration block using this collection
+    * as a synchronization lock.
+    */
+   public Iterator<Archive> iterator()
+   {
+      return archives.iterator();
+   }
+
+   /**
+    * Returns the BeanDeploymentArchive collection corresponding to this archive collection
+    *  
+    * @return a collection of all previously created BeanDeploymentArchives that represent
+    *         the archives in this collection
+    */
+   public Collection<BeanDeploymentArchive> getBDAs()
+   {
+      return this.bdas;
+   }
+
+   public synchronized void bdaCreated(BeanDeploymentArchive bda)
+   {
+      synchronized(bdas)
+      {
+         bdas.add(bda);
+      }
+   }
+
+   public synchronized void bdaDestroyed(BeanDeploymentArchive bda)
+   {
+      synchronized(bdas)
+      {
+         bdas.remove(bda);
+      }
+   }
+}


Property changes on: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/ArchiveCollection.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/ArchiveFactory.java
===================================================================
--- projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/ArchiveFactory.java	                        (rev 0)
+++ projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/ArchiveFactory.java	2010-05-31 14:16:23 UTC (rev 105413)
@@ -0,0 +1,61 @@
+/*
+ * 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.weld.integration.deployer.env.bda;
+
+import java.util.Collection;
+
+import org.jboss.weld.ejb.spi.EjbDescriptor;
+
+/**
+ * An archive factory.
+ * 
+ * @author <a href="mailto:flavia.rainone at jboss.com">Flavia Rainone</a>
+ * @version $Revision$
+ * @see Archive
+ */
+class ArchiveFactory
+{
+   /**
+    * Creates an Archive, and performs some initialization operations required for
+    * consistency and cleanup of the ArchiveInfo.
+    * <br>
+    * This factory method can be called only when {@code ejbs} become
+    * available. Prior to this stage, use {@link ArchiveInfo} to keep data during deployment.
+    * 
+    * @param archiveInfo contains all information necessary for the initialization of the
+    *                    archive
+    * @param ejbs        the list of EJB descriptors
+    */
+   public static Archive createArchive(ArchiveInfo archiveInfo, Collection<EjbDescriptor<?>> ejbs)
+   {
+      Archive archive = new Archive(archiveInfo, ejbs);
+      if (archiveInfo.hasClasspathAdapter())
+      {
+         // initialize adapter
+         ArchiveToClasspath classpathAdapter = archiveInfo.getClasspathAdapter();
+         classpathAdapter.addArchive(archive);
+      }
+      // dispose archiveInfo
+      archiveInfo.cleanUp();
+      return archive;
+   }
+}


Property changes on: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/ArchiveFactory.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/ArchiveInfo.java
===================================================================
--- projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/ArchiveInfo.java	                        (rev 0)
+++ projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/ArchiveInfo.java	2010-05-31 14:16:23 UTC (rev 105413)
@@ -0,0 +1,149 @@
+/*
+ * 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.weld.integration.deployer.env.bda;
+
+import java.util.Map;
+import java.util.WeakHashMap;
+
+import org.jboss.weld.integration.deployer.env.WeldDiscoveryEnvironment;
+
+/**
+ * Contains information necessary for the creation of an Archive.
+ * All the information contained in a ArchiveInfo is gathered during deployment and is
+ * not considered initialized (i.e., this information is not ready to be used for
+ * BeanDeploymentArchive and Deployment creation) 
+ * 
+ * @author <a href="mailto:flavia.rainone at jboss.com">Flavia Rainone</a>
+ * @version $Revision$
+ */
+public class ArchiveInfo
+{
+   // creates the classpaths for the archive
+   private static final ClasspathFactory classpathFactory = ClasspathFactory.getInstance();
+
+   // keeps track of the instances that are currently under use by depoyers
+   private static final Map<ClassLoader, ArchiveInfo> instances = new WeakHashMap<ClassLoader, ArchiveInfo>();
+   
+   /**
+    * Returns the ArchiveInfo instance that corresponds to the given class loader.
+    * Only ArchiveInfo instances under use can be returned.
+    * 
+    * @param classLoader the class loader
+    * @return            the ArchiveInfo instance that contains {@code classLoader}
+    */
+   public static final ArchiveInfo getInstance(ClassLoader classLoader)
+   {
+      return instances.get(classLoader);
+   }
+   
+   // adapts an Archive to a Classpath
+   private ArchiveToClasspath classpathAdapter;
+   // the classpath
+   private Classpath classpath;
+   // the class loader
+   private ClassLoader classLoader;
+   // the discovery environment
+   private final WeldDiscoveryEnvironment environment;
+   
+   /**
+    * Creates an ArchiveInfo to keep track of all data related to an archive
+    * during deployment.
+    * 
+    * @param classLoader the classLoader that is loading the archive under deployment.
+    */
+   public ArchiveInfo(ClassLoader classLoader)
+   {
+      instances.put(classLoader, this);
+      this.classLoader = classLoader;
+      this.classpath = classpathFactory.create(classLoader);
+      this.environment = new WeldDiscoveryEnvironment();
+   }
+
+   /**
+    * Returns the classloader that is loading the archive under deployment.
+    * 
+    * @return the classloader
+    */
+   public ClassLoader getClassLoader()
+   {
+      return this.classLoader;
+   }
+
+   /**
+    * The classpath of the archive under deployment.
+    * 
+    * @return the claspath
+    */
+   public Classpath getClasspath()
+   {
+      return classpath;
+   }
+
+   /**
+    * Returns the archive environment information.
+    * 
+    * @return the environment information
+    */
+   public WeldDiscoveryEnvironment getEnvironment()
+   {
+      return this.environment;
+   }
+
+   /**
+    * Returns a classpath adapter, indicating that the archive under deployment will be
+    * used as a classpath itself.
+    * 
+    * @return a classpath adapter
+    */
+   ArchiveToClasspath getClasspathAdapter()
+   {
+      if (classpathAdapter == null)
+      {
+         classpathAdapter = new ArchiveToClasspath();
+      }
+      return classpathAdapter;
+   }
+   
+   /**
+    * Indicates whether a classpath adapter for this archive has been created.
+    * 
+    * @return {@code true} if a classpath adapter has been created
+    */
+   boolean hasClasspathAdapter()
+   {
+      return this.classpathAdapter != null;
+   }
+
+   /**
+    * Performs cleanup of this archive, indicating that it is no longer in use and will
+    * be discarded.
+    */
+   void cleanUp()
+   {
+      instances.remove(this.classLoader);
+   }
+   
+   public String toString()
+   {
+      return "ArchiveInfo[" + classLoader + "]";
+   }
+}
\ No newline at end of file


Property changes on: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/ArchiveInfo.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/ArchiveToClasspath.java
===================================================================
--- projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/ArchiveToClasspath.java	                        (rev 0)
+++ projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/ArchiveToClasspath.java	2010-05-31 14:16:23 UTC (rev 105413)
@@ -0,0 +1,93 @@
+/*
+ * 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.weld.integration.deployer.env.bda;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+
+/**
+ * A Classpath adapter for an archive.
+ * This is used when a single Archive is used as classpath for another Archive.
+ * 
+ * @author <a href="mailto:flavia.rainone at jboss.com">Flavia Rainone</a>
+ * @version $Revision$
+ * @see Classpath
+ */
+class ArchiveToClasspath implements Classpath, BDALifecycleListener
+{
+   // the archive
+   private Archive archive;
+   // the bda corresponding to archive, if available
+   private Collection<BeanDeploymentArchive> bda;
+   // an unitary collection containing archive
+   private Collection<Archive> archives;
+
+   public String getName()
+   {
+      return archive.toString();
+   }
+
+   /**
+    * This method performs initialization of this classpath, setting the archive it
+    * represents.
+    * This classpath is not functional until this method is invoked.
+    */
+   public void addArchive(Archive archive)
+   {
+      this.archive = archive;
+      archives = new ArrayList<Archive>();
+      archives.add(archive);
+   }
+
+   public Iterator<Archive> iterator()
+   {
+      return archives.iterator();
+   }
+
+   public Collection<BeanDeploymentArchive> getBDAs(BeanDeploymentArchive bda)
+   {
+      if (this.bda == null)
+      {
+         return archive.getClasspath().getBDAs(bda);
+      }
+      return this.bda;
+   }
+
+   public void bdaCreated(BeanDeploymentArchive bda)
+   {
+      this.bda = new ArrayList<BeanDeploymentArchive>();
+      this.bda.add(bda);
+   }
+
+   public void bdaDestroyed(BeanDeploymentArchive bda)
+   {
+      // do nothing, as this instance is also being destroyed
+   }
+   
+   public String toString()
+   {
+      return archive.toString();
+   }
+}
\ No newline at end of file


Property changes on: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/ArchiveToClasspath.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/BDALifecycleListener.java
===================================================================
--- projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/BDALifecycleListener.java	                        (rev 0)
+++ projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/BDALifecycleListener.java	2010-05-31 14:16:23 UTC (rev 105413)
@@ -0,0 +1,48 @@
+/*
+ * 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.weld.integration.deployer.env.bda;
+
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+
+/**
+ * Observes the lifecyle of a BeanDeploymentArchive.
+ * 
+ * @author <a href="mailto:flavia.rainone at jboss.com">Flavia Rainone</a>
+ * @version $Revision: 1.1 
+ * @see Archive#addBDALifecycleListener(BDALifecycleListener)
+ */
+interface BDALifecycleListener
+{
+   /**
+    * Notifies that {@code bda} has been created.
+    * 
+    * @param bda the BeanDeploymentArchive
+    */
+   public void bdaCreated(BeanDeploymentArchive bda);
+   
+   /**
+    * Notifies that {@code bda} is being destroyed.
+    * 
+    * @param bda the BeanDeploymentArchive
+    */
+   public void bdaDestroyed(BeanDeploymentArchive bda);
+}


Property changes on: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/BDALifecycleListener.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/BeanDeploymentArchiveImpl.java
===================================================================
--- projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/BeanDeploymentArchiveImpl.java	                        (rev 0)
+++ projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/BeanDeploymentArchiveImpl.java	2010-05-31 14:16:23 UTC (rev 105413)
@@ -0,0 +1,106 @@
+/*
+ * 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.weld.integration.deployer.env.bda;
+
+import java.net.URL;
+import java.util.Collection;
+
+import org.jboss.weld.bootstrap.api.ServiceRegistry;
+import org.jboss.weld.bootstrap.api.helpers.SimpleServiceRegistry;
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.weld.ejb.spi.EjbDescriptor;
+
+/**
+ * {@link BeanDeploymentArchive} implementation for JBoss AS.
+ * 
+ * @author <a href="mailto:flavia.rainone at jboss.com">Flavia Rainone</a>
+ * @version $Revision$
+ */
+class BeanDeploymentArchiveImpl implements BeanDeploymentArchive
+{
+   // identifies this BDA
+   private final String id;
+
+   // the Archive that this BDA represents
+   private final Archive archive;
+
+   // the services provided by this BDA
+   private final ServiceRegistry services;
+
+   /**
+    * Constructor.
+    * 
+    * @param id      the identifier name of this BeanDeploymentArchive
+    * @param archive the archive that this BeanDeploymentArchive represents
+    */
+   public BeanDeploymentArchiveImpl(String id, Archive archive)
+   {
+      this.id = id;
+      this.archive = archive;
+      this.services = new SimpleServiceRegistry();
+   }
+
+   public Collection<BeanDeploymentArchive> getBeanDeploymentArchives()
+   {
+      return archive.getClasspath().getBDAs(this);
+   }
+
+   public Collection<Class<?>> getBeanClasses()
+   {
+      return archive.getClasses();
+   }
+
+   public Collection<URL> getBeansXml()
+   {
+      return archive.getXmlURLs();
+   }
+
+   public Collection<EjbDescriptor<?>> getEjbs()
+   {
+      return archive.getEjbs();
+   }
+
+   public ServiceRegistry getServices()
+   {
+      return services;
+   }
+
+   public String getId()
+   {
+      return id;
+   }
+
+   /**
+    * Returns the archive that this BDA represents.
+    * 
+    * @return the archive
+    */
+   public Archive getArchive()
+   {
+      return archive;
+   }
+   
+   public String toString()
+   {
+      return archive.toString();
+   }
+}
\ No newline at end of file


Property changes on: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/BeanDeploymentArchiveImpl.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/Classpath.java
===================================================================
--- projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/Classpath.java	                        (rev 0)
+++ projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/Classpath.java	2010-05-31 14:16:23 UTC (rev 105413)
@@ -0,0 +1,69 @@
+/*
+ * 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.weld.integration.deployer.env.bda;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+
+/**
+ * An archive classpath keeps track of the archives that are visible to an archive.
+ * It also works on BDA level, i.e., it can tell which BDAs are visible to a specific BDA.
+ * 
+ * @author <a href="mailto:flavia.rainone at jboss.com">Flavia Rainone</a>
+ * @version $Revision$
+ */
+public interface Classpath extends Iterable<Archive>
+{
+   /**
+    * Returns a name that identifies this classpath.
+    * 
+    * @return the name of this classpath
+    */
+   public String getName();
+
+   /**
+    * Adds an archive to this classpath. When an archive is added to a classpath, the
+    * corresponding BeanDeploymentArchive, when available, is automatically part of this
+    * classpath as well.
+    * 
+    * @param archive an archive
+    */
+   public void addArchive(Archive archive);
+
+   /**
+    * Returns an iterator over the set of archives contained in this classpath. 
+    * 
+    * @return an iterator for iterating over all archives that are part of this classpath
+    */
+   Iterator<Archive> iterator();
+
+   /**
+    * Returns the collection of all BeanDeploymentArchive instances reachable from 
+    * {@code bda}.
+    * 
+    * @param bda the BeanDeploymentArchive that is performing this query
+    * @return    a collection of all BDAs visible to {@code bda}
+    */
+   public Collection<BeanDeploymentArchive> getBDAs(BeanDeploymentArchive bda);
+}


Property changes on: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/Classpath.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/ClasspathFactory.java
===================================================================
--- projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/ClasspathFactory.java	                        (rev 0)
+++ projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/ClasspathFactory.java	2010-05-31 14:16:23 UTC (rev 105413)
@@ -0,0 +1,146 @@
+/*
+ * 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.weld.integration.deployer.env.bda;
+
+import java.lang.ref.WeakReference;
+import java.util.Map;
+import java.util.WeakHashMap;
+
+import org.jboss.classloader.plugins.loader.ClassLoaderToLoaderAdapter;
+import org.jboss.classloader.spi.ClassLoaderDomain;
+import org.jboss.classloader.spi.ClassLoaderSystem;
+import org.jboss.classloader.spi.Loader;
+import org.jboss.classloading.spi.dependency.Module;
+
+/**
+ * Given the ClassLoader that is loading an archive during deployment, this factory
+ * creates the corresponding classpath.
+ * 
+ * @author <a href="mailto:flavia.rainone at jboss.com">Flavia Rainone</a>
+ * @version $Revision$
+ */
+class ClasspathFactory
+{
+   private static final ClasspathFactory instance = new ClasspathFactory();
+   
+   /**
+    * Returns the singleton instance.
+    * 
+    * @return the ClasspathFactory instance
+    */
+   public static final ClasspathFactory getInstance()
+   {
+      return instance;
+   }
+   
+   // the default classpath, corresponds to DefaultDomain
+   public static final Classpath DEFAULT = new  ClasspathImpl("DefaultDomain");
+   
+   // the ClassLoaderSystem
+   private final ClassLoaderSystem system;
+
+   // a list of domains
+   private final Map<Loader, WeakReference<Classpath>> domainToClasspath;
+
+   private ClasspathFactory()
+   {
+      domainToClasspath = new WeakHashMap<Loader, WeakReference<Classpath>>();
+      system = ClassLoaderSystem.getInstance();
+   }
+
+   /**
+    * Creates the Classpath corresponding to ClassLoader.
+    * 
+    * @param classLoader the ClassLoader
+    * @return            a classpath that contains a list of the archives visible to
+    *                    ClassLoader.
+    */
+   public Classpath create(ClassLoader classLoader)
+   {
+      Module module = SecurityActions.getModuleForClassLoader(classLoader);
+      ClassLoaderDomain domain = null;
+      if (module != null && module.getDeterminedParentDomainName() != null)
+      {
+         domain = system.getDomain(module.getDeterminedDomainName());
+      }
+      return getClasspath(classLoader, domain);
+   }
+   
+   private Classpath getClasspath(ClassLoader cl, Loader domain)
+   {
+      if (domain == null)
+      {
+         return DEFAULT;
+      }
+      synchronized(domain)
+      {
+         Classpath classpath = getClasspath(domain);
+         if (classpath == null)
+         {
+            if (domain instanceof ClassLoaderToLoaderAdapter)
+            {
+               ClassLoaderToLoaderAdapter cp2la = (ClassLoaderToLoaderAdapter) domain;
+               ClassLoader unitLoader = SecurityActions.getClassLoader(cp2la);
+               ArchiveInfo archiveInfo = unitLoader == null? null: ArchiveInfo.getInstance(unitLoader);
+               if (archiveInfo == null)
+               {
+                  classpath = new ClasspathImpl(domain.toString());
+               }
+               else
+               {
+                  classpath = archiveInfo.getClasspathAdapter();
+               }
+            }
+            else
+            {
+               if (domain instanceof ClassLoaderDomain)
+               {
+                  ClassLoaderDomain clDomain = (ClassLoaderDomain) domain;
+                  Classpath parentClasspath = getClasspath(null, clDomain.getParent());
+                  classpath = new ClasspathImpl(clDomain.getName(), parentClasspath);
+               }
+               else
+               {
+                  throw new RuntimeException("Domain is of unexpected type: " + domain + " - " + domain.getClass());
+               }
+            }
+            addClasspath(domain, classpath);
+         }
+         return classpath;
+      }
+   }
+
+   private Classpath getClasspath(Loader domain)
+   {
+      WeakReference<Classpath> ref = domainToClasspath.get(domain);
+      if (ref == null)
+      {
+         return null;
+      }
+      return ref.get();
+   }
+   
+   private void addClasspath(Loader domain, Classpath domainClasspath)
+   {
+      domainToClasspath.put(domain, new WeakReference<Classpath>(domainClasspath));
+   }
+}
\ No newline at end of file


Property changes on: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/ClasspathFactory.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/ClasspathImpl.java
===================================================================
--- projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/ClasspathImpl.java	                        (rev 0)
+++ projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/ClasspathImpl.java	2010-05-31 14:16:23 UTC (rev 105413)
@@ -0,0 +1,123 @@
+/*
+ * 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.weld.integration.deployer.env.bda;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+
+/**
+ * Naïve implementation of Classpath. This implementation retrieves the
+ * BeanDeploymentArchives from the contained archives whenever the BDA collection is
+ * requested, and allows for duplicates in the collection.
+ * 
+ * @author <a href="mailto:flavia.rainone at jboss.com">Flavia Rainone</a>
+ * @version $Revision$
+ */
+class ClasspathImpl implements Classpath
+{
+   private Collection<Archive> archives = new ArrayList<Archive>();
+   private Classpath classpath;
+   private final String name;
+   
+   /**
+    * Constructor.
+    * 
+    * @param name     the name of this classpath
+    * @param archives the list of archives contained in this classpath
+    */
+   public ClasspathImpl (String name, Archive... archives)
+   {
+      this.name = name;
+      for (Archive archive: archives)
+      {
+         this.archives.add(archive);
+      }
+   }
+   
+   /**
+    * Constructor.
+    * 
+    * @param name      the name of this classpath
+    * @param classpath contain archives that are reachable from this classpath
+    * @param archives the list of archives contained in this classpath
+    */
+   public ClasspathImpl (String name, Classpath classpath, Archive... archives)
+   {
+      this(name, archives);
+      this.classpath = classpath;
+   }
+   
+   public String getName()
+   {
+      return this.name;
+   }
+
+   public void addArchive(Archive archive)
+   {
+      archives.add(archive);
+   }
+
+   public Iterator<Archive> iterator()
+   {
+      return archives.iterator();
+   }
+
+   public Collection<BeanDeploymentArchive> getBDAs(BeanDeploymentArchive bda)
+   {
+      if (archives.isEmpty() && classpath != null)
+      {
+         return classpath.getBDAs(bda);
+      }
+      Collection<BeanDeploymentArchive> bdas = getBDAsFromArchives();
+      if (bdas.isEmpty() && classpath != null)
+      {
+         return classpath.getBDAs(bda);
+      }
+      if (classpath != null)
+      {
+         bdas.addAll(classpath.getBDAs(bda));
+      }
+      return bdas;
+   }
+
+   public String toString()
+   {
+      return "Classpath[" + name + "]";
+   }
+
+   private Collection<BeanDeploymentArchive> getBDAsFromArchives()
+   {
+      Collection<BeanDeploymentArchive> bdas = new ArrayList<BeanDeploymentArchive>();
+      for (Archive archive: archives)
+      {
+         BeanDeploymentArchive bda = archive.getBeanDeploymentArchive();
+         if (bda != null)
+         {
+            bdas.add(archive.getBeanDeploymentArchive());
+         }
+      }
+      return bdas;
+   }
+}


Property changes on: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/ClasspathImpl.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/DeploymentImpl.java
===================================================================
--- projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/DeploymentImpl.java	                        (rev 0)
+++ projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/DeploymentImpl.java	2010-05-31 14:16:23 UTC (rev 105413)
@@ -0,0 +1,142 @@
+/*
+ * 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.weld.integration.deployer.env.bda;
+
+import java.util.Collection;
+import java.util.HashSet;
+
+import org.jboss.weld.bootstrap.api.ServiceRegistry;
+import org.jboss.weld.bootstrap.api.helpers.SimpleServiceRegistry;
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.weld.bootstrap.spi.Deployment;
+import org.jboss.weld.ejb.spi.EjbDescriptor;
+
+/**
+ * {@link Deployment} implementation for JBoss AS.
+ * 
+ * @author <a href="mailto:flavia.rainone at jboss.com">Flavia Rainone</a>
+ * @version $Revision$
+ */
+public class DeploymentImpl implements Deployment
+{
+   // the name of this deployment
+   private String name;
+
+   // the collection of archives contained in this deployment 
+   private final ArchiveCollection archives;
+
+   // the services provided by this deployment
+   private final ServiceRegistry services;
+
+   /**
+    * Constructor.
+    * 
+    * @param name         a name that identifies this deployment
+    * @param archiveInfos the information that will be used for creation of the archives
+    *                     contained in this deployment
+    * @param ejbs         the ejb descriptors
+    */
+   public DeploymentImpl(String name, Collection<ArchiveInfo> archiveInfos, Collection<EjbDescriptor<?>> ejbs)
+   {
+      this.name = name;
+      this.archives = new ArchiveCollection();
+      for (ArchiveInfo archiveInfo: archiveInfos)
+      {
+         Archive archive = ArchiveFactory.createArchive(archiveInfo, ejbs);
+         archives.add(archive);
+         if (archive.hasXml())
+         {
+            archive.createBeanDeploymentArchive();
+         }
+      }
+      this.services = new SimpleServiceRegistry();
+   }
+   
+   public Collection<BeanDeploymentArchive> getBeanDeploymentArchives()
+   {
+      return archives.getBDAs();
+   }
+
+   public ServiceRegistry getServices()
+   {
+     return this.services;
+   }
+
+   public BeanDeploymentArchive loadBeanDeploymentArchive(Class<?> beanClass)
+   {
+      // collection to mark the archives we have already searched
+      Collection<Archive> searchedArchives = new HashSet<Archive>();
+      // collection to mark the classpaths we have already searched
+      Collection<Classpath> searchedClasspaths = new HashSet<Classpath>();
+      Archive archive = findArchive(beanClass, archives, searchedArchives, searchedClasspaths);
+      if (archive == null)
+      {
+         throw new IllegalArgumentException("Bean class " + beanClass + " is not reachable from deployment " + this);
+      }
+      return archive.createBeanDeploymentArchive();
+   }
+   
+   public void undeploy()
+   {
+      for (Archive archive: archives)
+      {
+         archive.undeploy();
+      }
+   }
+   
+   public String toString()
+   {
+      return "Deployment[" + name + "]";
+   }
+   
+   private Archive findArchive(Class<?> beanClass, Iterable<Archive> archives, Collection<Archive> searchedArchives, Collection<Classpath> searchedClasspaths)
+   {
+      synchronized(archives) // TODO potential for a deadlock?
+      {
+         for (Archive archive: archives)
+         {
+            if (!searchedArchives.contains(archive))
+            {
+               if (archive.containsClass(beanClass))
+               {
+                  return archive;
+               }
+               else
+               {
+                  searchedArchives.add(archive);
+                  Classpath classpath = archive.getClasspath();
+                  if (!searchedClasspaths.contains(classpath))
+                  {
+                     searchedClasspaths.add(classpath);
+                     Archive found = findArchive(beanClass, classpath, searchedArchives, searchedClasspaths);
+                     if (found != null)
+                     {
+                        return found;
+                     }
+                  }
+               }
+            }
+         }
+      }
+      return null;
+   }
+}


Property changes on: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/DeploymentImpl.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/NoDuplicatesClasspath.java
===================================================================
--- projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/NoDuplicatesClasspath.java	                        (rev 0)
+++ projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/NoDuplicatesClasspath.java	2010-05-31 14:16:23 UTC (rev 105413)
@@ -0,0 +1,162 @@
+/*
+ * 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.weld.integration.deployer.env.bda;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+
+/**
+ * Classpath implementation that avoids duplication and keeps an updated list of
+ * BeanDeploymentArchives, thus avoiding the creation of this list every time it is
+ * retrieved.
+ * 
+ * @author <a href="mailto:flavia.rainone at jboss.com">Flavia Rainone</a>
+ * @version $Revision$
+ */
+class NoDuplicatesClasspath extends ArchiveCollection implements Classpath 
+{
+   // the classpath name
+   private final String name;
+
+   // A reference to this classpath. This reference BDA is returned as the single element
+   // in the BDA collection every time it is requested by the non-reference BDAs
+   private BeanDeploymentArchive reference = null;
+
+   // A collection containing the reference BDA
+   private Collection<BeanDeploymentArchive> referenceCollection = new ArrayList<BeanDeploymentArchive>();
+
+   // contains archives and BDAs reachable from this Classpath
+   private Classpath classpath;
+
+   /**
+    * Constructor.
+    * 
+    * @param name     a name that identifies this classpath
+    * @param archives the list of archives contained in this classpath
+    */
+   public NoDuplicatesClasspath (String name, Archive... archives)
+   {
+      this.name = name;
+      super.archives = new HashSet<Archive>();
+      for (Archive archive: archives)
+      {
+         add(archive);
+      }
+   }
+
+   /**
+    * Constructor.
+    * 
+    * @param name     a name that identifies this classpath
+    * @param archives the list of archives contained in this classpath
+    */
+   public NoDuplicatesClasspath (String name, Classpath classpath, Archive... archives)
+   {
+      this(name, archives);
+      this.classpath = classpath;
+   }
+
+   public String getName()
+   {
+      return this.name;
+   }
+
+   public void addArchive(Archive archive)
+   {
+      add(archive);
+   }
+
+   public Collection<BeanDeploymentArchive> getBDAs(BeanDeploymentArchive bda)
+   {
+      // if reference is null, it means that no BDA is contained in this classpath
+      if (reference == null && classpath != null)
+      {
+         return classpath.getBDAs(bda);
+      }
+      // only the reference BDA points to the other BDAs in this classpath
+      if (bda == reference)
+      {
+         return getBDAs();
+      }
+      else
+      {
+         // all other BDAs point only to reference BDA
+         return referenceCollection;
+      }
+   }
+
+   @Override
+   public void bdaCreated(BeanDeploymentArchive bda)
+   {
+      synchronized(bdas)
+      {
+         if (reference == null)
+         {
+            reference = bda;
+            referenceCollection.add(bda);
+         }
+         else
+         {
+            //only add to BDAs collection the BDAs that are not reference
+            super.bdaCreated(bda);
+         }
+      }
+   }
+   
+   @Override
+   public void bdaDestroyed(BeanDeploymentArchive bda)
+   {
+      synchronized(bdas)
+      {
+         if (reference == bda)
+         {
+            reference = null;
+            referenceCollection.clear();
+            if (!bdas.isEmpty())
+            {
+               Iterator<BeanDeploymentArchive> iterator = bdas.iterator();
+               reference = iterator.next();
+               iterator.remove();
+               referenceCollection.add(reference);
+            }
+         }
+         else
+         {
+            super.bdaDestroyed(bda);
+         }
+      }
+      synchronized(this)
+      {
+         Archive archive = ((BeanDeploymentArchiveImpl) bda).getArchive();
+         archives.remove(archive);
+      }
+   }
+
+   public String toString()
+   {
+      return "Classpath[" + this.name + "]";
+   }
+}
\ No newline at end of file


Property changes on: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/NoDuplicatesClasspath.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/SecurityActions.java
===================================================================
--- projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/SecurityActions.java	                        (rev 0)
+++ projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/SecurityActions.java	2010-05-31 14:16:23 UTC (rev 105413)
@@ -0,0 +1,84 @@
+/*
+ * 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.env.bda;
+
+import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+import org.jboss.classloader.spi.base.BaseClassLoaderSource;
+import org.jboss.classloading.spi.dependency.ClassLoading;
+import org.jboss.classloading.spi.dependency.Module;
+
+/**
+ * Executes privileged actions.
+ * 
+ * @author <a href="flavia.rainone at jboss.com">Flavia Rainone</a>
+ * @version $Revision$
+ */
+class SecurityActions
+{
+   private static final Method getClassLoader;
+
+   static
+   {
+      getClassLoader = AccessController.doPrivileged(new PrivilegedAction<Method>()
+      {
+         public Method run()
+         {
+            try
+            {
+               Method method = BaseClassLoaderSource.class.getDeclaredMethod("getClassLoader");
+               method.setAccessible(true);
+               return method;
+            }
+            catch (NoSuchMethodException e)
+            {
+               throw new RuntimeException("Cannot get classloader from " + BaseClassLoaderSource.class.getName(), e);
+            }
+         }
+      });
+   }
+
+   static ClassLoader getClassLoader(BaseClassLoaderSource clSource)
+   {
+      try
+      {
+         return (ClassLoader)getClassLoader.invoke(clSource);
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+   
+   public static Module getModuleForClassLoader(final ClassLoader classLoader)
+   {
+      return AccessController.doPrivileged(new PrivilegedAction<Module>()
+      {
+         public Module run()
+         {
+            return ClassLoading.getModuleForClassLoader(classLoader);
+         }
+      });
+   }
+}


Property changes on: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/main/java/org/jboss/weld/integration/deployer/env/bda/SecurityActions.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Modified: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/VFSTestSuite.java
===================================================================
--- projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/VFSTestSuite.java	2010-05-31 12:54:06 UTC (rev 105412)
+++ projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/VFSTestSuite.java	2010-05-31 14:16:23 UTC (rev 105413)
@@ -27,9 +27,10 @@
 
 import org.jboss.test.deployers.test.BootDeployerTestCase;
 import org.jboss.test.deployers.test.CLIsolationTestCase;
+import org.jboss.test.deployers.test.FlatDeploymentSmokeTestCase;
 import org.jboss.test.deployers.test.FlatDeploymentTestCase;
+import org.jboss.test.deployers.test.JBossDeploymentSmokeTestCase;
 import org.jboss.test.deployers.test.PostDeployersTestCase;
-import org.jboss.test.deployers.test.SmokeTestCase;
 import org.jboss.test.deployers.test.WeldDiscoveryEnvTestCase;
 
 /**
@@ -49,7 +50,8 @@
       TestSuite suite = new TestSuite("Deployers Weld Tests");
 
       // Smoke
-      suite.addTest(SmokeTestCase.suite());
+      suite.addTest(FlatDeploymentSmokeTestCase.suite());
+      suite.addTest(JBossDeploymentSmokeTestCase.suite());
 
       // Post metadata modification
       suite.addTest(PostDeployersTestCase.suite());

Modified: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/AbstractDeploymentTest.java
===================================================================
--- projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/AbstractDeploymentTest.java	2010-05-31 12:54:06 UTC (rev 105412)
+++ projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/AbstractDeploymentTest.java	2010-05-31 14:16:23 UTC (rev 105413)
@@ -59,6 +59,10 @@
    {
       for (BeanDeploymentArchive bda : archives)
       {
+         if (result.contains(bda))
+         {
+            continue;
+         }
          result.add(bda);
          getArchives(result, bda.getBeanDeploymentArchives());
       }

Added: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/ArchiveDiscoveryDeploymentTestCase.java
===================================================================
--- projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/ArchiveDiscoveryDeploymentTestCase.java	                        (rev 0)
+++ projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/ArchiveDiscoveryDeploymentTestCase.java	2010-05-31 14:16:23 UTC (rev 105413)
@@ -0,0 +1,204 @@
+/*
+ * 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.net.URL;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import junit.framework.Test;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.test.deployers.support.crm.CrmWebBean;
+import org.jboss.test.deployers.support.ejb.BusinessInterface;
+import org.jboss.test.deployers.support.ejb.MySLSBean;
+import org.jboss.test.deployers.support.ext.ExternalWebBean;
+import org.jboss.test.deployers.support.jar.PlainJavaBean;
+import org.jboss.test.deployers.support.ui.UIWebBean;
+import org.jboss.test.deployers.support.web.ServletWebBean;
+import org.jboss.vfs.VirtualFile;
+import org.jboss.weld.integration.deployer.env.WeldDiscoveryEnvironment;
+import org.jboss.weld.integration.deployer.env.bda.ArchiveInfo;
+
+/**
+ * ArchiveInfo environment discovery test case.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ * @author <a href="mailto:flavia.rainone at jboss.com">Flavia Rainone</a>
+ */
+public class ArchiveDiscoveryDeploymentTestCase extends AbstractWeldTest
+{
+   public ArchiveDiscoveryDeploymentTestCase(String name)
+   {
+      super(name);
+   }
+
+   public static Test suite()
+   {
+      return suite(ArchiveDiscoveryDeploymentTestCase.class);
+   }
+
+   public void testSimpleUsage() throws Exception
+   {
+      VirtualFile ear = createBasicEar();
+      VFSDeploymentUnit topUnit = assertDeploy(ear);
+      try
+      {
+         ArchiveInfo archiveInfo = topUnit.getAttachment(ArchiveInfo.class);
+         WeldDiscoveryEnvironment wbDiscovery = archiveInfo.getEnvironment();
+         assertNotNull("Null WBDiscoveryEnv.", wbDiscovery);
+
+         Set<String> expected = new HashSet<String>();
+         addExpectedResource(expected, "ejbs.jar");
+         addExpectedResource(expected, "ext.jar");
+         addExpectedResource(expected, "simple.jar");
+
+         for (URL url : wbDiscovery.getWeldXml())
+         {
+            boolean found = false;
+            Iterator<String> iter = expected.iterator();
+            while (iter.hasNext())
+            {
+               String expectedURL = iter.next();
+               if (url.toExternalForm().contains(expectedURL))
+               {
+                  iter.remove();
+                  found = true;
+                  break;
+               }
+            }
+            assertTrue("Unexpected wb url: " + url, found);
+         }
+
+         assertEmpty("Should be emtpy, missing " + expected, expected);
+
+         addExpectedClass(expected, BusinessInterface.class);
+         addExpectedClass(expected, MySLSBean.class);
+         addExpectedClass(expected, ExternalWebBean.class);
+         addExpectedClass(expected, PlainJavaBean.class);
+
+         for (Class<?> clazz : wbDiscovery.getWeldClasses())
+            assertTrue(expected.remove(clazz.getName()));
+
+         assertEmpty("Should be emtpy, missing " + expected, expected);
+         
+         for (DeploymentUnit unit: topUnit.getChildren())
+         {
+            archiveInfo = unit.getAttachment(ArchiveInfo.class);
+            if (unit.getName().contains("simple.war"))
+            {
+               assertNotNull(archiveInfo);
+               wbDiscovery = archiveInfo.getEnvironment();
+               expected = new HashSet<String>();
+               addExpectedResource(expected, "ui.jar");
+               addExpectedResource(expected, "simple.war", "/WEB-INF/beans.xml");
+
+               for (URL url : wbDiscovery.getWeldXml())
+               {
+                  boolean found = false;
+                  Iterator<String> iter = expected.iterator();
+                  while (iter.hasNext())
+                  {
+                     String expectedURL = iter.next();
+                     if (url.toExternalForm().contains(expectedURL))
+                     {
+                        iter.remove();
+                        found = true;
+                        break;
+                     }
+                  }
+                  assertTrue("Unexpected wb url: " + url, found);
+               }
+
+               assertEmpty("Should be emtpy, missing " + expected, expected);
+
+               addExpectedClass(expected, UIWebBean.class);
+               addExpectedClass(expected, ServletWebBean.class);
+               //addExpectedClass(expected, CrmWebBean.class);
+
+               for (Class<?> clazz : wbDiscovery.getWeldClasses())
+                  assertTrue(expected.remove(clazz.getName()));
+
+               assertEmpty("Should be emtpy, missing " + expected, expected);
+            }
+            else if (unit.getName().contains("crm.war"))
+            {
+               assertNotNull(archiveInfo);
+               wbDiscovery = archiveInfo.getEnvironment();
+               expected = new HashSet<String>();
+               addExpectedResource(expected, "crm.jar");
+
+               for (URL url : wbDiscovery.getWeldXml())
+               {
+                  boolean found = false;
+                  Iterator<String> iter = expected.iterator();
+                  while (iter.hasNext())
+                  {
+                     String expectedURL = iter.next();
+                     if (url.toExternalForm().contains(expectedURL))
+                     {
+                        iter.remove();
+                        found = true;
+                        break;
+                     }
+                  }
+                  assertTrue("Unexpected wb url: " + url, found);
+               }
+
+               assertEmpty("Should be emtpy, missing " + expected, expected);
+
+               addExpectedClass(expected, CrmWebBean.class);
+
+               for (Class<?> clazz : wbDiscovery.getWeldClasses())
+                  assertTrue(expected.remove(clazz.getName()));
+
+               assertEmpty("Should be emtpy, missing " + expected, expected);
+            }
+            else
+            {
+               assertNull("Unit " + unit.getName() +  " contains a not null ArchiveInfo", archiveInfo);
+            }
+         }
+      }
+      finally
+      {
+         undeploy(topUnit);
+      }
+   }
+
+   private static void addExpectedResource(Set<String> expected, String unit)
+   {
+      addExpectedResource(expected, unit, "/META-INF/beans.xml");
+   }
+
+   private static void addExpectedResource(Set<String> expected, String unit, String suffix)
+   {
+      expected.add(unit + suffix);
+   }
+
+   private static void addExpectedClass(Set<String> expected, Class<?> clazz)
+   {
+      expected.add(clazz.getName());
+   }
+}


Property changes on: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/ArchiveDiscoveryDeploymentTestCase.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/ArchiveInfoDeploymentTestCase.java
===================================================================
--- projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/ArchiveInfoDeploymentTestCase.java	                        (rev 0)
+++ projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/ArchiveInfoDeploymentTestCase.java	2010-05-31 14:16:23 UTC (rev 105413)
@@ -0,0 +1,82 @@
+/*
+ * 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.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.vfs.VirtualFile;
+import org.jboss.weld.integration.deployer.env.bda.ArchiveInfo;
+import org.jboss.weld.integration.deployer.env.bda.Classpath;
+
+/**
+ * ArchiveInfo deployment test case.
+ *
+ * @author <a href="mailto:flavia.rainone at jboss.com">Flavia Rainone</a>
+ * @version $Revision$
+ */
+public class ArchiveInfoDeploymentTestCase extends AbstractWeldTest
+{
+   public ArchiveInfoDeploymentTestCase(String name)
+   {
+      super(name);
+   }
+
+   public static Test suite()
+   {
+      return suite(ArchiveInfoDeploymentTestCase.class);
+   }
+
+   public void testSimpleUsage() throws Exception
+   {
+      VirtualFile ear = createBasicEar();
+      VFSDeploymentUnit topUnit = assertDeploy(ear);
+      try
+      {
+         ArchiveInfo archiveInfo = topUnit.getAttachment(ArchiveInfo.class);
+         assertNotNull("Null ArchiveInfo", archiveInfo);
+         Classpath defaultClasspath = archiveInfo.getClasspath();
+         assertNotNull(defaultClasspath);
+         assertEquals("DefaultDomain", defaultClasspath.getName());
+         for (DeploymentUnit unit: topUnit.getChildren())
+         {
+            archiveInfo = unit.getAttachment(ArchiveInfo.class);
+            if (unit.getName().endsWith(".war/"))
+            {
+               assertNotNull("Null ArchiveInfo", archiveInfo);
+               Classpath bdaClasspath = archiveInfo.getClasspath();
+               assertNotNull(bdaClasspath);
+               assertNotSame(defaultClasspath, bdaClasspath);
+            }
+            else
+            {
+               assertNull("ArchiveInfo for unit " + unit.getName() + " is not null", archiveInfo);
+            }
+         }
+      }
+      finally
+      {
+         undeploy(topUnit);
+      }
+   }
+}


Property changes on: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/ArchiveInfoDeploymentTestCase.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/FlatDeploymentSmokeTestCase.java
===================================================================
--- projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/FlatDeploymentSmokeTestCase.java	                        (rev 0)
+++ projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/FlatDeploymentSmokeTestCase.java	2010-05-31 14:16:23 UTC (rev 105413)
@@ -0,0 +1,43 @@
+/*
+ * 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;
+
+/**
+ * Smoke tests for FlatDeployment creation.
+ * 
+ * @author <a href="mailto:flavia.rainone at jboss.com">Flavia Rainone</a>
+ * @version $Revision$
+ */
+public class FlatDeploymentSmokeTestCase extends SmokeTestCase
+{
+   public FlatDeploymentSmokeTestCase(String name)
+   {
+      super(name);
+   }
+
+   public static Test suite()
+   {
+      return suite(FlatDeploymentSmokeTestCase.class);
+   }
+}
\ No newline at end of file


Property changes on: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/FlatDeploymentSmokeTestCase.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/JBossDeploymentSmokeTestCase.java
===================================================================
--- projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/JBossDeploymentSmokeTestCase.java	                        (rev 0)
+++ projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/JBossDeploymentSmokeTestCase.java	2010-05-31 14:16:23 UTC (rev 105413)
@@ -0,0 +1,43 @@
+/*
+ * 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;
+
+/**
+ * Smoke tests for JBossDeployment creation.
+ * 
+ * @author <a href="mailto:flavia.rainone at jboss.com">Flavia Rainone</a>
+ * @version $Revision$
+ */
+public class JBossDeploymentSmokeTestCase extends SmokeTestCase
+{
+   public JBossDeploymentSmokeTestCase(String name)
+   {
+      super(name);
+   }
+
+   public static Test suite()
+   {
+      return suite(JBossDeploymentSmokeTestCase.class);
+   }
+}
\ No newline at end of file


Property changes on: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/JBossDeploymentSmokeTestCase.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/JBossDeploymentTestCase.java
===================================================================
--- projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/JBossDeploymentTestCase.java	                        (rev 0)
+++ projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/JBossDeploymentTestCase.java	2010-05-31 14:16:23 UTC (rev 105413)
@@ -0,0 +1,56 @@
+/*
+ * 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.util.List;
+
+import junit.framework.Test;
+
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+
+/**
+ * JBoss Deployment test case.
+ *
+ * @author <a href="mailto:flavia.rainone at jboss.com">Flavia Rainone</a>
+ */
+public class JBossDeploymentTestCase extends AbstractDeploymentTest
+{
+   public JBossDeploymentTestCase(String name)
+   {
+      super(name);
+   }
+
+   public static Test suite()
+   {
+      return suite(JBossDeploymentTestCase.class);
+   }
+
+   protected int getExpectedArchives()
+   {
+      return 3;
+   }
+
+   protected void assertNewBeanDeploymentArchive(List<BeanDeploymentArchive> archives, BeanDeploymentArchive newBDA)
+   {
+      assertSame(newBDA, archives.iterator().next());
+   }
+}
\ No newline at end of file


Property changes on: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/JBossDeploymentTestCase.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Modified: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/SmokeTestCase.java
===================================================================
--- projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/SmokeTestCase.java	2010-05-31 12:54:06 UTC (rev 105412)
+++ projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/java/org/jboss/test/deployers/test/SmokeTestCase.java	2010-05-31 14:16:23 UTC (rev 105413)
@@ -21,8 +21,6 @@
  */
 package org.jboss.test.deployers.test;
 
-import junit.framework.Test;
-
 import org.jboss.dependency.spi.ControllerContext;
 import org.jboss.dependency.spi.ControllerState;
 import org.jboss.deployers.client.spi.DeployerClient;
@@ -39,18 +37,13 @@
  *
  * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
  */
-public class SmokeTestCase extends AbstractWeldTest
+public abstract class SmokeTestCase extends AbstractWeldTest
 {
    public SmokeTestCase(String name)
    {
       super(name);
    }
 
-   public static Test suite()
-   {
-      return suite(SmokeTestCase.class);
-   }
-
    protected void testDeployment(VirtualFile app) throws Exception
    {
       Deployment deployment = createVFSDeployment(app);

Added: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/resources/org/jboss/test/deployers/test/ArchiveDiscoveryDeploymentTestCase.xml
===================================================================
--- projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/resources/org/jboss/test/deployers/test/ArchiveDiscoveryDeploymentTestCase.xml	                        (rev 0)
+++ projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/resources/org/jboss/test/deployers/test/ArchiveDiscoveryDeploymentTestCase.xml	2010-05-31 14:16:23 UTC (rev 105413)
@@ -0,0 +1,14 @@
+<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="WarClassLoader" class="org.jboss.test.deployers.vfs.reflect.support.MockWarClassLoaderDeployer"/>
+
+  <bean name="JWBMDDeployer" class="org.jboss.weld.integration.deployer.ext.JBossWeldMetaDataDeployer"/>
+  <bean name="WBFilesDeployer" class="org.jboss.weld.integration.deployer.metadata.WeldFilesDeployer"/>
+  <bean name="ArchiveInfoDeployer" class="org.jboss.weld.integration.deployer.env.ArchiveInfoDeployer"/>
+
+  <!--  Target of the Test -->
+  <bean name="ArchiveDiscoveryDeployer" class="org.jboss.weld.integration.deployer.env.ArchiveDiscoveryDeployer"/>
+
+</deployment>

Added: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/resources/org/jboss/test/deployers/test/ArchiveInfoDeploymentTestCase.xml
===================================================================
--- projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/resources/org/jboss/test/deployers/test/ArchiveInfoDeploymentTestCase.xml	                        (rev 0)
+++ projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/resources/org/jboss/test/deployers/test/ArchiveInfoDeploymentTestCase.xml	2010-05-31 14:16:23 UTC (rev 105413)
@@ -0,0 +1,10 @@
+<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="WarClassLoader" class="org.jboss.test.deployers.vfs.reflect.support.MockWarClassLoaderDeployer"/>
+
+  <!--  Target of the Test -->
+  <bean name="ArchiveInfoDeployer" class="org.jboss.weld.integration.deployer.env.ArchiveInfoDeployer"/>
+
+</deployment>

Copied: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/resources/org/jboss/test/deployers/test/FlatDeploymentSmokeTestCase.xml (from rev 104795, projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/resources/org/jboss/test/deployers/test/SmokeTestCase.xml)
===================================================================
--- projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/resources/org/jboss/test/deployers/test/FlatDeploymentSmokeTestCase.xml	                        (rev 0)
+++ projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/resources/org/jboss/test/deployers/test/FlatDeploymentSmokeTestCase.xml	2010-05-31 14:16:23 UTC (rev 105413)
@@ -0,0 +1,61 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+  <!-- Structure mocks -->
+
+  <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"/>
+
+  <!-- Mock metadata deployer -->
+
+  <bean name="JBAppMDDeployer" class="org.jboss.test.deployers.support.deployer.MockJBossAppDeployer"/>
+  <bean name="JBWMDDeployer" class="org.jboss.test.deployers.support.deployer.MockWebDeployer"/>
+  <bean name="EjbJarDeployer" class="org.jboss.test.deployers.support.deployer.MockEjbJarDeployer"/>
+  <bean name="EjbMergeDeployer" class="org.jboss.test.deployers.support.deployer.MockCopyJBossDeployer"/>
+  <bean name="WarCLDeployer" class="org.jboss.test.deployers.support.deployer.MockWarClassLoaderDeployer"/>
+
+  <!-- Weld deployers -->
+
+  <!-- Responsible for discovering Weld files -->
+  <bean name="WeldFilesDeployer" class="org.jboss.weld.integration.deployer.metadata.WeldFilesDeployer"/>
+
+  <!-- Responsible for discovering Weld classes -->
+  <bean name="WeldDiscoveryDeployer" class="org.jboss.weld.integration.deployer.env.WeldDiscoveryDeployer"/>
+
+  <!-- Responsible for discovering Weld classes -->
+  <bean name="EjbServicesDeployer" class="org.jboss.weld.integration.deployer.env.EjbServicesDeployer"/>
+
+  <!-- Responsible for discovering Weld classes -->
+  <bean name="FlatDeploymentDeployer" class="org.jboss.weld.integration.deployer.env.FlatDeploymentDeployer"/>
+
+  <!-- Responsible for dynamic ejb dependency creation -->
+  <bean name="DynamicDependencyCreator" class="org.jboss.weld.integration.deployer.env.DynamicDependencyCreator">
+    <constructor>
+      <parameter><inject bean="jboss.kernel:service=KernelController"/></parameter>
+    </constructor>
+  </bean>
+
+  <!-- Responsible for booting Weld -->
+  <bean name="WeldBootstrapDeployer" class="org.jboss.weld.integration.deployer.env.WeldBootstrapDeployer"/>
+
+  <!-- Binds bootstrap to jndi -->
+  <bean name="JndiBinderDeployer" class="org.jboss.test.deployers.support.deployer.MockJndiBinderDeployer"/>
+
+  <!-- Missing real URL integration tests-->
+
+  <bean name="MockUrlIntegrationDeployer" class="org.jboss.test.deployers.support.deployer.MockUrlIntegrationDeployer"/>
+
+  <!-- Responsible for inserting the Weld EJB interceptor -->
+  <bean name="PostEjbJarMetadataDeployer" class="org.jboss.weld.integration.deployer.metadata.WeldEjbInterceptorMetadataDeployer"/>
+
+  <!-- Responsible for enabling classloader isolation for Weld jars -->
+  <bean name="PostJBossMetadataDeployer" class="org.jboss.weld.integration.deployer.metadata.PostJBossMetadataDeployer"/>
+
+  <!-- Responsible for enabling classloader isolation for Weld wars -->
+  <bean name="PostJBossWebMetadataDeployer" class="org.jboss.weld.integration.deployer.metadata.PostJBossWebMetadataDeployer"/>
+
+  <!-- Responsible for adding the Weld listener to the Servlet -->
+  <bean name="PostWebMetadataDeployer" class="org.jboss.weld.integration.deployer.metadata.PostWebMetadataDeployer"/>
+
+  <!-- Removed WeldJndiBinder -->
+
+</deployment>

Added: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/resources/org/jboss/test/deployers/test/JBossDeploymentSmokeTestCase.xml
===================================================================
--- projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/resources/org/jboss/test/deployers/test/JBossDeploymentSmokeTestCase.xml	                        (rev 0)
+++ projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/resources/org/jboss/test/deployers/test/JBossDeploymentSmokeTestCase.xml	2010-05-31 14:16:23 UTC (rev 105413)
@@ -0,0 +1,64 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+  <!-- Structure mocks -->
+
+  <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"/>
+
+  <!-- Mock metadata deployer -->
+
+  <bean name="JBAppMDDeployer" class="org.jboss.test.deployers.support.deployer.MockJBossAppDeployer"/>
+  <bean name="JBWMDDeployer" class="org.jboss.test.deployers.support.deployer.MockWebDeployer"/>
+  <bean name="EjbJarDeployer" class="org.jboss.test.deployers.support.deployer.MockEjbJarDeployer"/>
+  <bean name="EjbMergeDeployer" class="org.jboss.test.deployers.support.deployer.MockCopyJBossDeployer"/>
+  <bean name="WarCLDeployer" class="org.jboss.test.deployers.support.deployer.MockWarClassLoaderDeployer"/>
+
+  <!-- Weld deployers -->
+
+  <!-- Responsible for discovering Weld files -->
+  <bean name="WeldFilesDeployer" class="org.jboss.weld.integration.deployer.metadata.WeldFilesDeployer"/>
+
+  <!-- Responsible for creating an ArchiveInfo for every module -->
+  <bean name="ArchiveInfoDeployer" class="org.jboss.weld.integration.deployer.env.ArchiveInfoDeployer"/>
+
+  <!-- Responsible for discovering Weld classes -->
+  <bean name="DiscoveryDeployer" class="org.jboss.weld.integration.deployer.env.ArchiveDiscoveryDeployer"/>
+
+  <!-- Responsible for discovering Weld classes -->
+  <bean name="EjbServicesDeployer" class="org.jboss.weld.integration.deployer.env.EjbServicesDeployer"/>
+
+  <!-- Responsible for generating metadata for the creation of a Deployment -->
+  <bean name="DeploymentDeployer" class="org.jboss.weld.integration.deployer.env.JBossDeploymentDeployer"/>
+
+  <!-- Responsible for dynamic ejb dependency creation -->
+  <bean name="DynamicDependencyCreator" class="org.jboss.weld.integration.deployer.env.DynamicDependencyCreator">
+    <constructor>
+      <parameter><inject bean="jboss.kernel:service=KernelController"/></parameter>
+    </constructor>
+  </bean>
+
+  <!-- Responsible for booting Weld -->
+  <bean name="WeldBootstrapDeployer" class="org.jboss.weld.integration.deployer.env.WeldBootstrapDeployer"/>
+
+  <!-- Binds bootstrap to jndi -->
+  <bean name="JndiBinderDeployer" class="org.jboss.test.deployers.support.deployer.MockJndiBinderDeployer"/>
+
+  <!-- Missing real URL integration tests-->
+
+  <bean name="MockUrlIntegrationDeployer" class="org.jboss.test.deployers.support.deployer.MockUrlIntegrationDeployer"/>
+
+  <!-- Responsible for inserting the Weld EJB interceptor -->
+  <bean name="PostEjbJarMetadataDeployer" class="org.jboss.weld.integration.deployer.metadata.WeldEjbInterceptorMetadataDeployer"/>
+
+  <!-- Responsible for enabling classloader isolation for Weld jars -->
+  <bean name="PostJBossMetadataDeployer" class="org.jboss.weld.integration.deployer.metadata.PostJBossMetadataDeployer"/>
+
+  <!-- Responsible for enabling classloader isolation for Weld wars -->
+  <bean name="PostJBossWebMetadataDeployer" class="org.jboss.weld.integration.deployer.metadata.PostJBossWebMetadataDeployer"/>
+
+  <!-- Responsible for adding the Weld listener to the Servlet -->
+  <bean name="PostWebMetadataDeployer" class="org.jboss.weld.integration.deployer.metadata.PostWebMetadataDeployer"/>
+
+  <!-- Removed WeldJndiBinder -->
+
+</deployment>

Added: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/resources/org/jboss/test/deployers/test/JBossDeploymentTestCase.xml
===================================================================
--- projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/resources/org/jboss/test/deployers/test/JBossDeploymentTestCase.xml	                        (rev 0)
+++ projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/resources/org/jboss/test/deployers/test/JBossDeploymentTestCase.xml	2010-05-31 14:16:23 UTC (rev 105413)
@@ -0,0 +1,33 @@
+<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="WarClassLoader" class="org.jboss.test.deployers.vfs.reflect.support.MockWarClassLoaderDeployer"/>
+
+  <bean name="JWBMDDeployer" class="org.jboss.weld.integration.deployer.ext.JBossWeldMetaDataDeployer"/>
+  <bean name="WBFilesDeployer" class="org.jboss.weld.integration.deployer.metadata.WeldFilesDeployer"/>
+  <bean name="ArchiveInfoDeployer" class="org.jboss.weld.integration.deployer.env.ArchiveInfoDeployer"/>
+  <bean name="ArchiveDiscoveryDeployer" class="org.jboss.weld.integration.deployer.env.ArchiveDiscoveryDeployer"/>
+
+  <beanfactory name="JBossEjbServices" class="org.jboss.test.deployers.support.MockEmptyEjbServices"/>
+
+  <bean name="EjbServicesDeployer" class="org.jboss.weld.integration.deployer.env.EjbServicesDeployer">
+    <property name="ejbServicesClassName">org.jboss.test.deployers.support.MockEmptyEjbServices</property>
+  </bean>
+
+  <!-- Target of the Test -->
+  <bean name="DeploymentDeployer" class="org.jboss.weld.integration.deployer.env.JBossDeploymentDeployer"/>
+
+  <bean name="BootDeployer" class="org.jboss.test.deployers.support.deployer.MockBootDeployer"/>
+
+  <bean name="DynamicDependencyCreator" class="org.jboss.weld.integration.deployer.env.DynamicDependencyCreator">
+    <constructor>
+      <parameter><inject bean="jboss.kernel:service=KernelController"/></parameter>
+    </constructor>
+  </bean>
+
+  <bean name="JBossTransactionServices" class="org.jboss.test.deployers.support.MockTransactionServices"/>
+
+  <bean name="RealTransactionManager" class="java.lang.Object"/>
+
+</deployment>

Deleted: projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/resources/org/jboss/test/deployers/test/SmokeTestCase.xml
===================================================================
--- projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/resources/org/jboss/test/deployers/test/SmokeTestCase.xml	2010-05-31 12:54:06 UTC (rev 105412)
+++ projects/weld-int/branches/Deployment_WELDINT-1/deployer/src/test/resources/org/jboss/test/deployers/test/SmokeTestCase.xml	2010-05-31 14:16:23 UTC (rev 105413)
@@ -1,61 +0,0 @@
-<deployment xmlns="urn:jboss:bean-deployer:2.0">
-
-  <!-- Structure mocks -->
-
-  <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"/>
-
-  <!-- Mock metadata deployer -->
-
-  <bean name="JBAppMDDeployer" class="org.jboss.test.deployers.support.deployer.MockJBossAppDeployer"/>
-  <bean name="JBWMDDeployer" class="org.jboss.test.deployers.support.deployer.MockWebDeployer"/>
-  <bean name="EjbJarDeployer" class="org.jboss.test.deployers.support.deployer.MockEjbJarDeployer"/>
-  <bean name="EjbMergeDeployer" class="org.jboss.test.deployers.support.deployer.MockCopyJBossDeployer"/>
-  <bean name="WarCLDeployer" class="org.jboss.test.deployers.support.deployer.MockWarClassLoaderDeployer"/>
-
-  <!-- Weld deployers -->
-
-  <!-- Responsible for discovering Weld files -->
-  <bean name="WeldFilesDeployer" class="org.jboss.weld.integration.deployer.metadata.WeldFilesDeployer"/>
-
-  <!-- Responsible for discovering Weld classes -->
-  <bean name="WeldDiscoveryDeployer" class="org.jboss.weld.integration.deployer.env.WeldDiscoveryDeployer"/>
-
-  <!-- Responsible for discovering Weld classes -->
-  <bean name="EjbServicesDeployer" class="org.jboss.weld.integration.deployer.env.EjbServicesDeployer"/>
-
-  <!-- Responsible for discovering Weld classes -->
-  <bean name="FlatDeploymentDeployer" class="org.jboss.weld.integration.deployer.env.FlatDeploymentDeployer"/>
-
-  <!-- Responsible for dynamic ejb dependency creation -->
-  <bean name="DynamicDependencyCreator" class="org.jboss.weld.integration.deployer.env.DynamicDependencyCreator">
-    <constructor>
-      <parameter><inject bean="jboss.kernel:service=KernelController"/></parameter>
-    </constructor>
-  </bean>
-
-  <!-- Responsible for booting Weld -->
-  <bean name="WeldBootstrapDeployer" class="org.jboss.weld.integration.deployer.env.WeldBootstrapDeployer"/>
-
-  <!-- Binds bootstrap to jndi -->
-  <bean name="JndiBinderDeployer" class="org.jboss.test.deployers.support.deployer.MockJndiBinderDeployer"/>
-
-  <!-- Missing real URL integration tests-->
-
-  <bean name="MockUrlIntegrationDeployer" class="org.jboss.test.deployers.support.deployer.MockUrlIntegrationDeployer"/>
-
-  <!-- Responsible for inserting the Weld EJB interceptor -->
-  <bean name="PostEjbJarMetadataDeployer" class="org.jboss.weld.integration.deployer.metadata.WeldEjbInterceptorMetadataDeployer"/>
-
-  <!-- Responsible for enabling classloader isolation for Weld jars -->
-  <bean name="PostJBossMetadataDeployer" class="org.jboss.weld.integration.deployer.metadata.PostJBossMetadataDeployer"/>
-
-  <!-- Responsible for enabling classloader isolation for Weld wars -->
-  <bean name="PostJBossWebMetadataDeployer" class="org.jboss.weld.integration.deployer.metadata.PostJBossWebMetadataDeployer"/>
-
-  <!-- Responsible for adding the Weld listener to the Servlet -->
-  <bean name="PostWebMetadataDeployer" class="org.jboss.weld.integration.deployer.metadata.PostWebMetadataDeployer"/>
-
-  <!-- Removed WeldJndiBinder -->
-
-</deployment>




More information about the jboss-cvs-commits mailing list