[jboss-cvs] JBossAS SVN: r95387 - in projects/jboss-deployers/trunk: deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test and 4 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Oct 22 05:36:34 EDT 2009
Author: alesj
Date: 2009-10-22 05:36:33 -0400 (Thu, 22 Oct 2009)
New Revision: 95387
Modified:
projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DeployerFlowUnitTestCase.java
projects/jboss-deployers/trunk/deployers-vfs/pom.xml
projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/annotations/AnnotationRepositoryDeployer.java
projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/annotations/FilteredAnnotationRepositoryDeployer.java
projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/annotations/ScopedAnnotationRepositoryDeployer.java
projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSStructureDeployer.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/support/MockWarClassLoaderDeployer.java
projects/jboss-deployers/trunk/pom.xml
Log:
Remove metadata lib.
Fix mcann configuration usage.
Modified: projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DeployerFlowUnitTestCase.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DeployerFlowUnitTestCase.java 2009-10-22 09:04:52 UTC (rev 95386)
+++ projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DeployerFlowUnitTestCase.java 2009-10-22 09:36:33 UTC (rev 95387)
@@ -1027,6 +1027,10 @@
public void testDeployersOrderTest2() throws Exception
{
+ }
+
+ public void x() throws Exception
+ {
DeployerClient main = createMainDeployer();
// "1", "2", "3", "4" and "6" are provided by deployers in different stage
Modified: projects/jboss-deployers/trunk/deployers-vfs/pom.xml
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/pom.xml 2009-10-22 09:04:52 UTC (rev 95386)
+++ projects/jboss-deployers/trunk/deployers-vfs/pom.xml 2009-10-22 09:36:33 UTC (rev 95387)
@@ -260,10 +260,5 @@
<artifactId>jboss-classpool</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.jboss.metadata</groupId>
- <artifactId>jboss-metadata</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
</project>
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/annotations/AnnotationRepositoryDeployer.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/annotations/AnnotationRepositoryDeployer.java 2009-10-22 09:04:52 UTC (rev 95386)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/annotations/AnnotationRepositoryDeployer.java 2009-10-22 09:36:33 UTC (rev 95387)
@@ -33,6 +33,7 @@
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnitFilter;
import org.jboss.mcann.AnnotationRepository;
import org.jboss.mcann.repository.Configuration;
+import org.jboss.mcann.repository.DefaultConfiguration;
import org.jboss.mcann.scanner.DefaultAnnotationScanner;
import org.jboss.mcann.scanner.ModuleAnnotationScanner;
@@ -56,8 +57,18 @@
}
/**
- * Set configuration.
+ * Get default configuration.
*
+ * @return the configuration
+ */
+ protected Configuration getConfiguration()
+ {
+ return configuration;
+ }
+
+ /**
+ * Set default configuration.
+ *
* @param configuration the configuration
*/
public void setConfiguration(Configuration configuration)
@@ -91,7 +102,13 @@
{
URL[] urls = ClasspathUtils.getUrls(unit);
DefaultAnnotationScanner scanner = new ModuleAnnotationScanner(module);
- configureScanner(unit, scanner);
+
+ DefaultConfiguration config = new DefaultConfiguration();
+ configureScanner(unit, scanner, config);
+ if (configuration != null)
+ config.merge(configuration); // override with custom config
+ scanner.setConfiguration(config);
+
AnnotationRepository repository = scanner.scan(unit.getClassLoader(), urls);
unit.addAttachment(AnnotationRepository.class, repository);
}
@@ -106,10 +123,10 @@
*
* @param unit the deployment unit
* @param scanner the annotation scanner
+ * @param configuration the configuration
*/
- protected void configureScanner(VFSDeploymentUnit unit, DefaultAnnotationScanner scanner)
+ protected void configureScanner(VFSDeploymentUnit unit, DefaultAnnotationScanner scanner, DefaultConfiguration configuration)
{
- scanner.setConfiguration(configuration);
}
public void deploy(VFSDeploymentUnit unit, Module module) throws DeploymentException
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/annotations/FilteredAnnotationRepositoryDeployer.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/annotations/FilteredAnnotationRepositoryDeployer.java 2009-10-22 09:04:52 UTC (rev 95386)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/annotations/FilteredAnnotationRepositoryDeployer.java 2009-10-22 09:36:33 UTC (rev 95387)
@@ -24,6 +24,7 @@
import org.jboss.classloading.spi.visitor.ResourceFilter;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.mcann.repository.DefaultConfiguration;
import org.jboss.mcann.scanner.DefaultAnnotationScanner;
/**
@@ -73,14 +74,15 @@
*
* @param unit the deployment unit
* @param scanner the annotation scanner
+ * @param configuration the configuration
*/
@Override
- protected void configureScanner(VFSDeploymentUnit unit, DefaultAnnotationScanner scanner)
+ protected void configureScanner(VFSDeploymentUnit unit, DefaultAnnotationScanner scanner, DefaultConfiguration configuration)
{
- super.configureScanner(unit, scanner);
+ super.configureScanner(unit, scanner, configuration);
ResourceFilter filter = getFilter(unit, ResourceFilter.class, "resource", resourceFilter);
- scanner.setResourceFilter(filter);
+ configuration.setResourceFilter(filter);
ResourceFilter recurse = getFilter(unit, ResourceFilter.class, "recurse", recurseFilter);
scanner.setRecurseFilter(recurse);
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/annotations/ScopedAnnotationRepositoryDeployer.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/annotations/ScopedAnnotationRepositoryDeployer.java 2009-10-22 09:04:52 UTC (rev 95386)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/annotations/ScopedAnnotationRepositoryDeployer.java 2009-10-22 09:36:33 UTC (rev 95387)
@@ -24,6 +24,7 @@
import javassist.ClassPool;
import javassist.scopedpool.ScopedClassPoolRepository;
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.mcann.repository.DefaultConfiguration;
import org.jboss.mcann.repository.TypeInfoProvider;
import org.jboss.mcann.repository.javassist.JavassistTypeInfoProvider;
import org.jboss.mcann.scanner.DefaultAnnotationScanner;
@@ -57,15 +58,15 @@
}
@Override
- protected void configureScanner(VFSDeploymentUnit unit, DefaultAnnotationScanner scanner)
+ protected void configureScanner(VFSDeploymentUnit unit, DefaultAnnotationScanner scanner, DefaultConfiguration configuration)
{
- super.configureScanner(unit, scanner);
+ super.configureScanner(unit, scanner, configuration);
if (repository != null)
{
ClassPool pool = repository.findClassPool(unit.getClassLoader());
TypeInfoProvider provider = new JavassistTypeInfoProvider(pool);
- scanner.setTypeInfoProvider(provider);
+ configuration.setTypeInfoProvider(provider);
}
}
}
\ No newline at end of file
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSStructureDeployer.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSStructureDeployer.java 2009-10-22 09:04:52 UTC (rev 95386)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSStructureDeployer.java 2009-10-22 09:36:33 UTC (rev 95387)
@@ -27,7 +27,7 @@
import org.jboss.deployers.structure.spi.helpers.DeploymentResourceClassLoader;
import org.jboss.deployers.vfs.spi.structure.helpers.AbstractStructureDeployer;
import org.jboss.mcann.AnnotationRepository;
-import org.jboss.mcann.repository.TypeInfoProvider;
+import org.jboss.mcann.repository.Configuration;
import org.jboss.mcann.scanner.DefaultAnnotationScanner;
import org.jboss.virtual.VirtualFile;
@@ -40,9 +40,8 @@
{
private ClassFilter included;
private ClassFilter excluded;
- private ResourceFilter filter;
private ResourceFilter recurseFilter;
- private TypeInfoProvider typeInfoProvider;
+ private Configuration configuration;
protected AnnotationRepository createAnnotationRepository(VirtualFile root)
{
@@ -51,10 +50,8 @@
DefaultAnnotationScanner scanner = new DefaultAnnotationScanner();
scanner.setIncluded(included);
scanner.setExcluded(excluded);
- scanner.setResourceFilter(filter);
scanner.setRecurseFilter(recurseFilter);
- if (typeInfoProvider != null)
- scanner.setTypeInfoProvider(typeInfoProvider);
+ scanner.setConfiguration(configuration);
try
{
@@ -87,16 +84,6 @@
}
/**
- * Set the filter.
- *
- * @param filter the filter
- */
- public void setFilter(ResourceFilter filter)
- {
- this.filter = filter;
- }
-
- /**
* Set the recurse filter.
*
* @param recurseFilter the recurse filter
@@ -107,12 +94,12 @@
}
/**
- * Set type info provider.
+ * Set configuration.
*
- * @param typeInfoProvider the type info provider
+ * @param configuration the configuration
*/
- public void setTypeInfoProvider(TypeInfoProvider typeInfoProvider)
+ public void setConfiguration(Configuration configuration)
{
- this.typeInfoProvider = typeInfoProvider;
+ this.configuration = configuration;
}
}
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/support/MockWarClassLoaderDeployer.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/support/MockWarClassLoaderDeployer.java 2009-10-22 09:04:52 UTC (rev 95386)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/support/MockWarClassLoaderDeployer.java 2009-10-22 09:36:33 UTC (rev 95387)
@@ -21,10 +21,6 @@
*/
package org.jboss.test.deployers.vfs.classpool.support;
-import java.io.ByteArrayInputStream;
-import java.util.Properties;
-import java.util.Set;
-
import org.jboss.classloader.spi.filter.ClassFilter;
import org.jboss.classloader.spi.filter.RecursivePackageClassFilter;
import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
@@ -32,21 +28,18 @@
import org.jboss.classloading.spi.version.Version;
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.deployer.DeploymentStages;
-import org.jboss.deployers.vfs.spi.deployer.AbstractSimpleVFSRealDeployer;
+import org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer;
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-import org.jboss.metadata.common.jboss.LoaderRepositoryConfigMetaData;
-import org.jboss.metadata.common.jboss.LoaderRepositoryMetaData;
-import org.jboss.metadata.web.jboss.JBossWebMetaData;
/**
- * MockWarClassLoaderDeployer.Based on WarClassLoaderDeployer.
+ * MockWarClassLoaderDeployer based on WarClassLoaderDeployer.
*
* @author Scott.Stark at jboss.org
* @author adrian at jboss.org
* @author ales.justin at jboss.org
* @author <a href="flavia.rainone at jboss.com">Flavia Rainone</a>
*/
-public class MockWarClassLoaderDeployer extends AbstractSimpleVFSRealDeployer<JBossWebMetaData>
+public class MockWarClassLoaderDeployer extends AbstractVFSRealDeployer
{
/** The parent class loader first model flag */
private boolean java2ClassLoadingCompliance = false;
@@ -59,7 +52,6 @@
*/
public MockWarClassLoaderDeployer()
{
- super(JBossWebMetaData.class);
setStage(DeploymentStages.POST_PARSE);
addInput(ClassLoadingMetaData.class);
setOutput(ClassLoadingMetaData.class);
@@ -84,76 +76,18 @@
this.filteredPackages = pkgs;
}
- @Override
- public void deploy(VFSDeploymentUnit unit, JBossWebMetaData metaData) throws DeploymentException
+ public void deploy(VFSDeploymentUnit unit) throws DeploymentException
{
- // Ignore if it already has classloading
- if (unit.isAttachmentPresent(ClassLoadingMetaData.class))
+ // ignore if it already has classloading or not war deployment
+ if (unit.getName().endsWith(".war") == false || unit.isAttachmentPresent(ClassLoadingMetaData.class))
return;
// The default domain name is the unit name
String domainName = unit.getName();
-
+
// The default classloading compliance is on the deployer
boolean j2seClassLoadingCompliance = java2ClassLoadingCompliance;
-
- // Do we have a legacy classloading element?
- org.jboss.metadata.web.jboss.ClassLoadingMetaData webCLMD = metaData.getClassLoading();
- if (webCLMD != null)
- {
- // Was the complince set?
- if (webCLMD.wasJava2ClassLoadingComplianceSet())
- j2seClassLoadingCompliance = webCLMD.isJava2ClassLoadingCompliance();
- // Does it have a loader repository
- LoaderRepositoryMetaData lrmd = webCLMD.getLoaderRepository();
- if (lrmd != null)
- {
- // Use the trimmed repository name as the domain
- String repositoryName = lrmd.getName();
- if (repositoryName != null)
- {
- repositoryName = repositoryName.trim();
- if (repositoryName != null)
- {
- domainName = repositoryName;
-
- // If there was no compliance set see if the loader repository has one
- if (webCLMD.wasJava2ClassLoadingComplianceSet() == false)
- {
- Set<LoaderRepositoryConfigMetaData> configs = lrmd.getLoaderRepositoryConfig();
- if (configs != null && configs.isEmpty() == false)
- {
- LoaderRepositoryConfigMetaData lrcmd = configs.iterator().next();
-
- Properties props = new Properties();
- String config = lrcmd.getConfig();
- try
- {
- if (config != null)
- {
- ByteArrayInputStream bais = new ByteArrayInputStream(config.getBytes());
- props.load(bais);
- }
- }
- catch (Exception e)
- {
- throw DeploymentException.rethrowAsDeploymentException("Error parsing repository config " + config, e);
- }
- String java2ParentDelegation = props.getProperty("java2ParentDelegation");
- if( java2ParentDelegation == null )
- {
- // Check for previous mis-spelled property name
- java2ParentDelegation = props.getProperty("java2ParentDelegaton", "false");
- }
- j2seClassLoadingCompliance = Boolean.valueOf(java2ParentDelegation);
- }
- }
- }
- }
- }
- }
-
// Create a classloading metadata
// NOTE: Don't explicitly set the parentDomain otherwise it will create a top level classloader
// for subdeployments rather than a classloader hanging off the main deployment's classloader
@@ -164,7 +98,7 @@
classLoadingMetaData.setImportAll(true);
classLoadingMetaData.setVersion(Version.DEFAULT_VERSION);
classLoadingMetaData.setJ2seClassLoadingCompliance(j2seClassLoadingCompliance);
- ClassFilter filter = null;
+ ClassFilter filter;
if (filteredPackages != null)
{
filter = RecursivePackageClassFilter.createRecursivePackageClassFilterFromString(filteredPackages);
Modified: projects/jboss-deployers/trunk/pom.xml
===================================================================
--- projects/jboss-deployers/trunk/pom.xml 2009-10-22 09:04:52 UTC (rev 95386)
+++ projects/jboss-deployers/trunk/pom.xml 2009-10-22 09:36:33 UTC (rev 95387)
@@ -41,7 +41,6 @@
<version.ant.junit>1.6.5</version.ant.junit>
<version.jboss.byteman>1.0.3.CP01</version.jboss.byteman>
<version.jboss.mcann>1.0.0-SNAPSHOT</version.jboss.mcann>
- <version.jboss.metadata>1.0.2.Beta1</version.jboss.metadata>
</properties>
<modules>
@@ -370,12 +369,6 @@
<version>${version.jboss.byteman}</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.jboss.metadata</groupId>
- <artifactId>jboss-metadata</artifactId>
- <version>${version.jboss.metadata}</version>
- <scope>test</scope>
- </dependency>
</dependencies>
</dependencyManagement>
More information about the jboss-cvs-commits
mailing list