[jboss-cvs] JBossAS SVN: r73729 - in projects/jboss-deployers/trunk: deployers-vfs-spi/src/main/org/jboss/deployers/vfs/spi/deployer and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed May 28 04:08:34 EDT 2008
Author: alesj
Date: 2008-05-28 04:08:33 -0400 (Wed, 28 May 2008)
New Revision: 73729
Modified:
projects/jboss-deployers/trunk/deployers-spi/src/main/org/jboss/deployers/spi/annotations/AnnotationEnvironment.java
projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/org/jboss/deployers/vfs/spi/deployer/MultipleObjectModelFactoryDeployer.java
Log:
Javadocs on AnnEnv.
Better OMF helper methods.
Modified: projects/jboss-deployers/trunk/deployers-spi/src/main/org/jboss/deployers/spi/annotations/AnnotationEnvironment.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-spi/src/main/org/jboss/deployers/spi/annotations/AnnotationEnvironment.java 2008-05-28 05:21:46 UTC (rev 73728)
+++ projects/jboss-deployers/trunk/deployers-spi/src/main/org/jboss/deployers/spi/annotations/AnnotationEnvironment.java 2008-05-28 08:08:33 UTC (rev 73729)
@@ -31,6 +31,9 @@
/**
* Information holder about annotation processing.
*
+ * Implementations should delay the actual class loading
+ * until it's absolutely necessary.
+ *
* @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
*/
public interface AnnotationEnvironment
@@ -38,7 +41,13 @@
/**
* Does this annotation environment contain a class
* which is annotated with annotation parameter.
+ * This only applies to annotations for ElementType.TYPE level.
*
+ * This method should be used if we have no intention
+ * to do real lookup of annotated classes, but we're
+ * only interested in existance of the annotation.
+ * e.g. deployment unit contains @Stateful EJBs
+ *
* @param annotation the annotation we're querying for
* @return true if there exists a class with annotation param
* @see #hasClassAnnotatedWith(Class annotation)
Modified: projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/org/jboss/deployers/vfs/spi/deployer/MultipleObjectModelFactoryDeployer.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/org/jboss/deployers/vfs/spi/deployer/MultipleObjectModelFactoryDeployer.java 2008-05-28 05:21:46 UTC (rev 73728)
+++ projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/org/jboss/deployers/vfs/spi/deployer/MultipleObjectModelFactoryDeployer.java 2008-05-28 08:08:33 UTC (rev 73729)
@@ -51,14 +51,29 @@
tRoot = expectedType.cast(root);
else
tRoot = null;
- return getHelper().parse(expectedType, file, tRoot, getObjectModelFactory(tRoot));
+ return getHelper().parse(expectedType, file, tRoot, getObjectModelFactory(expectedType, file, tRoot));
}
/**
* Get the object model factory
*
+ * @param expectedType the expected class
+ * @param file - the file we're about to parse
* @param root - possibly null pre-existing root
* @return the object model factory
*/
- protected abstract ObjectModelFactory getObjectModelFactory(Object root);
+ protected <U> ObjectModelFactory getObjectModelFactory(Class<U> expectedType, VirtualFile file, U root)
+ {
+ return getObjectModelFactory(expectedType, file.getName(), root);
+ }
+
+ /**
+ * Get the object model factory
+ *
+ * @param expectedType the expected class
+ * @param fileName - the fileName
+ * @param root - possibly null pre-existing root
+ * @return the object model factory
+ */
+ protected abstract <U> ObjectModelFactory getObjectModelFactory(Class<U> expectedType, String fileName, U root);
}
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list