[jboss-cvs] JBossAS SVN: r108242 - trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/env.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Sep 21 09:28:14 EDT 2010
Author: flavia.rainone at jboss.com
Date: 2010-09-21 09:28:13 -0400 (Tue, 21 Sep 2010)
New Revision: 108242
Modified:
trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/env/ArchiveDiscoveryDeployer.java
Log:
[JBAS-8433] Add empty weld archives support to ArchiveDiscoveryDeployer
Modified: trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/env/ArchiveDiscoveryDeployer.java
===================================================================
--- trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/env/ArchiveDiscoveryDeployer.java 2010-09-21 13:08:33 UTC (rev 108241)
+++ trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/env/ArchiveDiscoveryDeployer.java 2010-09-21 13:28:13 UTC (rev 108242)
@@ -33,7 +33,6 @@
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;
@@ -77,7 +76,7 @@
try
{
ArchiveInfo archive = null;
- if (hasCp)
+ if (hasCp || hasWB)
{
VFSDeploymentUnit moduleUnit = unit;
Module module = moduleUnit.getAttachment(Module.class);
@@ -88,34 +87,29 @@
}
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 (hasCp)
+ {
+ URL[] urls = new URL[cpFiles.size()];
+ int i = 0;
+ for (VirtualFile file : cpFiles)
+ {
+ urls[i++] = file.toURL();
+ }
+ 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)
{
More information about the jboss-cvs-commits
mailing list