This is all already done. ;-)
-
http://anonsvn.jboss.org/repos/jbossas/projects/jboss-deployers/trunk/dep...
The entry point to this is
-
http://anonsvn.jboss.org/repos/jbossas/projects/jboss-deployers/trunk/dep...
where you can then access the information via
-
http://anonsvn.jboss.org/repos/jbossas/projects/jboss-deployers/trunk/dep...
There is one AnnotationEnvironment instance per Module (classloading info) instance in
deployment.
AnnotationEnvironment instance is kept in DeploymentUnit,
so, if you can get access to DeploymentUnit, you have an access to annotations info.
See how Seam-int gets access to DeploymentUnit/AnnotationEnvironment:
-
http://anonsvn.jboss.org/repos/jbossas/projects/jboss-seam-int/trunk/jbos...
-
http://anonsvn.jboss.org/repos/jbossas/projects/jboss-seam-int/trunk/jbos...
The nice part about this annotation scanning is, that it's Javassist based, meaning it
doesn't actually load classes until really needed.
And doing this over Module means you already follow all the import/export classloading
rules.
e.g. you won't have access to 'hidden' resources
In JBossAS this is already used for EJB3 annotation scanning.
And there are already plans to use this more tightly in Seam/JSR299.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4204797#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...