[jboss-cvs] JBossAS SVN: r110435 - in trunk/weld-int/deployer/src: main/java/org/jboss/weld/integration/deployer/scanning and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Jan 24 03:59:55 EST 2011
Author: alesj
Date: 2011-01-24 03:59:54 -0500 (Mon, 24 Jan 2011)
New Revision: 110435
Modified:
trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/cl/WeldCoreIntegrationDeployer.java
trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/cl/WeldFacesIntegrationDeployer.java
trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/cl/WeldMcExtensionsIntegrationDeployer.java
trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/cl/WeldUrlIntegrationDeployer.java
trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/cl/WeldWebTierIntegrationDeployer.java
trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/scanning/WeldScanningPlugin.java
trunk/weld-int/deployer/src/test/java/org/jboss/test/deployers/support/deployer/MockUrlIntegrationDeployer.java
Log:
Cleanup Weld integration deployers a bit.
Modified: trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/cl/WeldCoreIntegrationDeployer.java
===================================================================
--- trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/cl/WeldCoreIntegrationDeployer.java 2011-01-24 07:21:14 UTC (rev 110434)
+++ trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/cl/WeldCoreIntegrationDeployer.java 2011-01-24 08:59:54 UTC (rev 110435)
@@ -16,12 +16,9 @@
{
super(JBossWeldMetaData.class);
setTopLevelOnly(true); // only top level, as that's where Bootstrap bean is gonna be
- setInputs(DeployersUtils.WELD_FILES);
- setIntegrationURLs(getURLs());
}
- @Override // we override this, as we want any beans.xml
- protected boolean isIntegrationDeployment(VFSDeploymentUnit unit)
+ protected boolean isIntegrationDeploymentInternal(VFSDeploymentUnit unit)
{
return DeployersUtils.checkForWeldFilesAcrossDeployment(unit);
}
Modified: trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/cl/WeldFacesIntegrationDeployer.java
===================================================================
--- trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/cl/WeldFacesIntegrationDeployer.java 2011-01-24 07:21:14 UTC (rev 110434)
+++ trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/cl/WeldFacesIntegrationDeployer.java 2011-01-24 08:59:54 UTC (rev 110435)
@@ -19,12 +19,9 @@
// We do this at top level to ensure that any deployment (ear or war)
// that supports WB gets this integration (even if that particular war doesn't have beans.xml)
setDisableOptional(true);
- setInputs(DeployersUtils.WELD_FILES);
- setIntegrationURLs(getURLs());
}
- @Override // we override this, as we want any beans.xml
- protected boolean isIntegrationDeployment(VFSDeploymentUnit unit)
+ protected boolean isIntegrationDeploymentInternal(VFSDeploymentUnit unit)
{
return DeployersUtils.checkForWeldFiles(unit, false);
}
Modified: trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/cl/WeldMcExtensionsIntegrationDeployer.java
===================================================================
--- trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/cl/WeldMcExtensionsIntegrationDeployer.java 2011-01-24 07:21:14 UTC (rev 110434)
+++ trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/cl/WeldMcExtensionsIntegrationDeployer.java 2011-01-24 08:59:54 UTC (rev 110435)
@@ -9,6 +9,7 @@
* Web Beans core integration deployer.
*
* @author <a href="mailto:mariusb at redhat.com">Marius Bogoevici</a>
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
*/
public class WeldMcExtensionsIntegrationDeployer extends WeldUrlIntegrationDeployer<JBossWeldMetaData>
{
@@ -16,12 +17,9 @@
{
super(JBossWeldMetaData.class);
setTopLevelOnly(true); // only top level, as that's where Bootstrap bean is gonna be
- setInputs(DeployersUtils.WELD_FILES);
- setIntegrationURLs(getURLs());
}
- @Override // we override this, as we want any beans.xml
- protected boolean isIntegrationDeployment(VFSDeploymentUnit unit)
+ protected boolean isIntegrationDeploymentInternal(VFSDeploymentUnit unit)
{
return DeployersUtils.checkForWeldFilesAcrossDeployment(unit);
}
Modified: trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/cl/WeldUrlIntegrationDeployer.java
===================================================================
--- trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/cl/WeldUrlIntegrationDeployer.java 2011-01-24 07:21:14 UTC (rev 110434)
+++ trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/cl/WeldUrlIntegrationDeployer.java 2011-01-24 08:59:54 UTC (rev 110435)
@@ -7,7 +7,9 @@
import java.util.Set;
import org.jboss.deployers.vfs.plugins.classloader.PathUrlIntegrationDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
import org.jboss.util.StringPropertyReplacer;
+import org.jboss.weld.integration.deployer.DeployersUtils;
/**
* Web Beans RI integration deployer.
@@ -20,12 +22,27 @@
protected WeldUrlIntegrationDeployer(Class<T> input)
{
super(input);
+ setInputs(DeployersUtils.WELD_FILES);
setIntegrationURLs(getURLs());
}
+ protected boolean isIntegrationDeployment(VFSDeploymentUnit unit)
+ {
+ return isIntegrationDeploymentInternal(unit);
+ }
+
/**
+ * Check if this is integration deployment.
+ *
+ * @param unit the current deployment unit
+ * @return true if integration, false otherwise
+ */
+ protected abstract boolean isIntegrationDeploymentInternal(VFSDeploymentUnit unit);
+
+ /**
* Get the short name.
- * @return
+ *
+ * @return the short name
*/
protected abstract String getShortLibName();
Modified: trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/cl/WeldWebTierIntegrationDeployer.java
===================================================================
--- trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/cl/WeldWebTierIntegrationDeployer.java 2011-01-24 07:21:14 UTC (rev 110434)
+++ trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/cl/WeldWebTierIntegrationDeployer.java 2011-01-24 08:59:54 UTC (rev 110435)
@@ -18,11 +18,10 @@
setDisableOptional(true); // it needs to be web deployment, or why would you use JSF?
}
- @Override
- protected boolean isIntegrationDeployment(VFSDeploymentUnit unit)
+ protected boolean isIntegrationDeploymentInternal(VFSDeploymentUnit unit)
{
// assume that it is an integration deployment
- return DeployersUtils.checkForWeldFiles(unit,false);
+ return DeployersUtils.checkForWeldFiles(unit, false);
}
protected String getShortLibName()
Modified: trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/scanning/WeldScanningPlugin.java
===================================================================
--- trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/scanning/WeldScanningPlugin.java 2011-01-24 07:21:14 UTC (rev 110434)
+++ trunk/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/scanning/WeldScanningPlugin.java 2011-01-24 08:59:54 UTC (rev 110435)
@@ -123,7 +123,7 @@
public void visit(ResourceContext resource)
{
- env.addWeldClass(resource.loadClass().getName());
+ env.addWeldClass(resource.getClassName());
}
}
}
\ No newline at end of file
Modified: trunk/weld-int/deployer/src/test/java/org/jboss/test/deployers/support/deployer/MockUrlIntegrationDeployer.java
===================================================================
--- trunk/weld-int/deployer/src/test/java/org/jboss/test/deployers/support/deployer/MockUrlIntegrationDeployer.java 2011-01-24 07:21:14 UTC (rev 110434)
+++ trunk/weld-int/deployer/src/test/java/org/jboss/test/deployers/support/deployer/MockUrlIntegrationDeployer.java 2011-01-24 08:59:54 UTC (rev 110435)
@@ -25,6 +25,8 @@
import java.util.Collections;
import java.util.Set;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.vfs.VirtualFile;
import org.jboss.weld.integration.deployer.cl.WeldUrlIntegrationDeployer;
import org.jboss.weld.integration.deployer.ext.JBossWeldMetaData;
@@ -45,6 +47,24 @@
return "<ignore>";
}
+ protected boolean isIntegrationDeploymentInternal(VFSDeploymentUnit unit)
+ {
+ // This is a copy from PathUrlIntegrationDeployer
+
+ String[] files = getFiles();
+ if (files == null || files.length == 0)
+ return false;
+
+ for(String path : files)
+ {
+ VirtualFile vf = unit.getFile(path);
+ if (vf != null)
+ return true;
+ }
+
+ return false;
+ }
+
@Override
protected Set<URL> getURLs()
{
More information about the jboss-cvs-commits
mailing list