[jboss-cvs] JBossAS SVN: r95408 - in projects/jboss-deployers/trunk: deployers-impl/src/test/java/org/jboss/test/deployers/annotations/test and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Oct 22 10:19:49 EDT 2009
Author: alesj
Date: 2009-10-22 10:19:49 -0400 (Thu, 22 Oct 2009)
New Revision: 95408
Modified:
projects/jboss-deployers/trunk/deployers-impl/src/main/java/org/jboss/deployers/plugins/annotations/GenericAnnotationDeployer.java
projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/annotations/test/AnnotationsTest.java
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/structure/AbstractVFSStructureDeployer.java
Log:
Use config creator.
Modified: projects/jboss-deployers/trunk/deployers-impl/src/main/java/org/jboss/deployers/plugins/annotations/GenericAnnotationDeployer.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-impl/src/main/java/org/jboss/deployers/plugins/annotations/GenericAnnotationDeployer.java 2009-10-22 13:59:45 UTC (rev 95407)
+++ projects/jboss-deployers/trunk/deployers-impl/src/main/java/org/jboss/deployers/plugins/annotations/GenericAnnotationDeployer.java 2009-10-22 14:19:49 UTC (rev 95408)
@@ -27,7 +27,7 @@
import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.mcann.AnnotationRepository;
-import org.jboss.mcann.repository.Configuration;
+import org.jboss.mcann.repository.ConfigurationCreator;
import org.jboss.mcann.scanner.DefaultAnnotationScanner;
import org.jboss.mcann.scanner.ModuleAnnotationScanner;
@@ -38,7 +38,7 @@
*/
public class GenericAnnotationDeployer extends AbstractSimpleRealDeployer<Module>
{
- private Configuration configuration;
+ private ConfigurationCreator creator;
public GenericAnnotationDeployer()
{
@@ -52,7 +52,9 @@
try
{
DefaultAnnotationScanner scanner = new ModuleAnnotationScanner(deployment);
- scanner.setConfiguration(configuration);
+ if (creator != null)
+ scanner.setConfiguration(creator.createConfiguration());
+
AnnotationRepository repository = scanner.scan(unit.getClassLoader());
unit.addAttachment(AnnotationRepository.class, repository);
}
@@ -63,12 +65,12 @@
}
/**
- * Set configuration.
+ * Set configuration creator.
*
- * @param configuration the configuration
+ * @param creator the configuration creator
*/
- public void setConfiguration(Configuration configuration)
+ public void setConfigurationCreator(ConfigurationCreator creator)
{
- this.configuration = configuration;
+ this.creator = creator;
}
}
Modified: projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/annotations/test/AnnotationsTest.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/annotations/test/AnnotationsTest.java 2009-10-22 13:59:45 UTC (rev 95407)
+++ projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/annotations/test/AnnotationsTest.java 2009-10-22 14:19:49 UTC (rev 95408)
@@ -48,6 +48,8 @@
import org.jboss.mcann.AnnotationRepository;
import org.jboss.mcann.Element;
import org.jboss.mcann.repository.DefaultConfiguration;
+import org.jboss.mcann.repository.ConfigurationCreator;
+import org.jboss.mcann.repository.Configuration;
import org.jboss.mcann.repository.javassist.JavassistTypeInfoProvider;
import org.jboss.test.deployers.AbstractDeployerTest;
import org.jboss.test.deployers.annotations.support.InterceptionClassLoader;
@@ -197,9 +199,16 @@
protected Deployer createGenericAnnotationDeployer()
{
GenericAnnotationDeployer deployer = new GenericAnnotationDeployer();
- DefaultConfiguration configuration = new DefaultConfiguration();
+ final DefaultConfiguration configuration = new DefaultConfiguration();
applyConfiguration(configuration);
- deployer.setConfiguration(configuration);
+ ConfigurationCreator creator = new ConfigurationCreator()
+ {
+ public Configuration createConfiguration()
+ {
+ return configuration;
+ }
+ };
+ deployer.setConfigurationCreator(creator);
return deployer;
}
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 13:59:45 UTC (rev 95407)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/annotations/AnnotationRepositoryDeployer.java 2009-10-22 14:19:49 UTC (rev 95408)
@@ -32,7 +32,7 @@
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnitFilter;
import org.jboss.mcann.AnnotationRepository;
-import org.jboss.mcann.repository.Configuration;
+import org.jboss.mcann.repository.ConfigurationCreator;
import org.jboss.mcann.repository.DefaultConfiguration;
import org.jboss.mcann.scanner.DefaultAnnotationScanner;
import org.jboss.mcann.scanner.ModuleAnnotationScanner;
@@ -44,7 +44,7 @@
*/
public class AnnotationRepositoryDeployer extends AbstractOptionalVFSRealDeployer<Module>
{
- private Configuration configuration;
+ private ConfigurationCreator creator;
private VFSDeploymentUnitFilter filter;
public AnnotationRepositoryDeployer()
@@ -57,26 +57,16 @@
}
/**
- * Get default configuration.
+ * Set configuration creator.
*
- * @return the configuration
+ * @param creator the configuration creator
*/
- protected Configuration getConfiguration()
+ public void setConfigurationCreator(ConfigurationCreator creator)
{
- return configuration;
+ this.creator = creator;
}
/**
- * Set default configuration.
- *
- * @param configuration the configuration
- */
- public void setConfiguration(Configuration configuration)
- {
- this.configuration = configuration;
- }
-
- /**
* Set vfs deployment filter.
*
* @param filter the vfs deployment filter.
@@ -105,8 +95,8 @@
DefaultConfiguration config = new DefaultConfiguration();
configureScanner(unit, scanner, config);
- if (configuration != null)
- config.merge(configuration); // override with custom config
+ if (creator != null)
+ config.merge(creator.createConfiguration()); // override with custom config
scanner.setConfiguration(config);
AnnotationRepository repository = scanner.scan(unit.getClassLoader(), urls);
@@ -152,7 +142,7 @@
}
if (log.isTraceEnabled())
- log.trace("Creating AnnotationRepository for " + unit.getName() + ", module: " + module + ", configuration: " + configuration);
+ log.trace("Creating AnnotationRepository for " + unit.getName() + ", module: " + module + ", configuration: " + creator);
visitModule(unit, module);
}
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 13:59:45 UTC (rev 95407)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSStructureDeployer.java 2009-10-22 14:19:49 UTC (rev 95408)
@@ -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.Configuration;
+import org.jboss.mcann.repository.ConfigurationCreator;
import org.jboss.mcann.scanner.DefaultAnnotationScanner;
import org.jboss.virtual.VirtualFile;
@@ -41,7 +41,7 @@
private ClassFilter included;
private ClassFilter excluded;
private ResourceFilter recurseFilter;
- private Configuration configuration;
+ private ConfigurationCreator creator;
protected AnnotationRepository createAnnotationRepository(VirtualFile root)
{
@@ -51,8 +51,8 @@
scanner.setIncluded(included);
scanner.setExcluded(excluded);
scanner.setRecurseFilter(recurseFilter);
- if (configuration != null)
- scanner.setConfiguration(configuration);
+ if (creator != null)
+ scanner.setConfiguration(creator.createConfiguration());
try
{
@@ -95,12 +95,12 @@
}
/**
- * Set configuration.
+ * Set configuration creator.
*
- * @param configuration the configuration
+ * @param creator the configuration creator
*/
- public void setConfiguration(Configuration configuration)
+ public void setConfigurationCreator(ConfigurationCreator creator)
{
- this.configuration = configuration;
+ this.creator = creator;
}
}
More information about the jboss-cvs-commits
mailing list