-
1. Re: JBAOP-87 - Annotation Dependencies
kabirkhan Jul 4, 2006 1:59 PM (in response to adrian.brock)I have added some more tests for this (JBAOP-239).
Is the rest of JBAOP-87 simply a matter of annotating things from the "aspects" module - or do I need to look at other modules as well? -
2. Re: JBAOP-87 - Annotation Dependencies
kabirkhan Jul 11, 2006 10:29 AM (in response to adrian.brock)Is the plan for it to be possible to create nested annotations from the MC xml?
e.g some xml like<bean name="Intercepted" class="org.jboss.test.microcontainer.support.SimpleBeanImpl"> <annotation ....> </bean>
which could result in something like@Containing(dependency=@TestAnnotationDependency(data="Dependency1"), contained=@Contained(dependencies= {@TestAnnotationDependency(data="Dependency2"), @TestAnnotationDependency(data="Dependency3")})) public class NestedAnnotatedSimpleBeanImpl extends SimpleBeanImpl { }
-
3. Re: JBAOP-87 - Annotation Dependencies
adrian.brock Jul 12, 2006 5:53 AM (in response to adrian.brock)Yes, but currently only strings are supported by AnnotationAttributeMetaData
Like I said on a different thread, there should be a way to construct
all objects that can go in all annotations.
For primitive types, this would just be the same as what
StringValueMetaData does, i.e. use TypeInfo.convertValue.
I'm not sure what the syntax would look like for the annotation
you describe? -
4. Re: JBAOP-87 - Annotation Dependencies
kabirkhan Jul 13, 2006 5:25 PM (in response to adrian.brock)Yes, I guess how this works at the moment is kind of hackish - I construct a string, similar to the -aop.xml annotation introductions/overides, that I pass in to the aop annotation creator. I'll look at doing this differently.
I'll try to come up with an xml syntax once I've looked into it -
5. Re: JBAOP-87 - Annotation Dependencies
adrian.brock Jul 14, 2006 7:02 AM (in response to adrian.brock)I think it will be a good idea to make the MC annotation xml more free format.
Writing your example annotation in xml would be very verbose
and pointless unless we are going to allow injections into the annotation,
e.g.<!-- Potentially injected annotation construction --> <annotation name="Blah"> <attribute name="DataSourceName"><inject bean="SomeDS" property="name"/> </annotation>
Better would be to just support:<annotation> @Containing(dependency=@TestAnnotationDependency(data="Dependency1"), contained=@Contained(dependencies= {@TestAnnotationDependency(data="Dependency2"), @TestAnnotationDependency(data="Dependency3")})) </annotation>
-
6. Re: JBAOP-87 - Annotation Dependencies
adrian.brock Jul 14, 2006 7:10 AM (in response to adrian.brock)Also as part of the metadata stuff I'm doing, I've been looking
at what it would take to move the AOP Annotation implementation into container and fix it to make it properly.
This is because I need a generic method to populate annotations
at all levels of metadata, e.g. (pseudo xml)<deployment ...> <annotation>@DeploymentLevelAnnotation</annotation> </deployment> or <deployment subsystem="JCA"> <annotation>@SecurityDomain("DefaultJCARealm")</annotation> </deployment>
However when I looked at the AOP implementation, it has two problems:
1) It does not implement the Annotation properly - no annotationType()
2) It does not add default values
Obviously to apply default values, is going to require javassist
to read them from the annotation interface class.
I'd also like to be able to use constructed annotations without javassist
in the classpath, even if that means default values won't be applied.
So what I'd like is an annotation factory that can vary based
on whether javassist is in the classpath. -
7. Re: JBAOP-87 - Annotation Dependencies
kabirkhan Jul 14, 2006 11:57 AM (in response to adrian.brock)I've got this moved out the container on my machine. I'll try to get the javassist stuff working this weekend, and then I'll update the mc snapshot jars in the repository.
I've kept the signature of the AnnotationCreator.create method untyped since I'm not sure at this stage if I want to force JDK 1.4 users to have their annotation interfaces implementing org.jboss.lang.Annotationpublic static Object createAnnotation(final String annotationExpr, final Class annotation) throws Exception
-
8. Re: JBAOP-87 - Annotation Dependencies
kabirkhan Jul 14, 2006 12:09 PM (in response to adrian.brock)BTW how should we manage the dependency from AOP on the container?
jboss-aop.deployer contains the aop stuff
jboss-bean.deployer contains jboss-container.jar
I will also need to create a retroed version of the jboss-container.jar that can be used with the aop JDK 1.4 distribution. -
9. Re: JBAOP-87 - Annotation Dependencies
adrian.brock Jul 14, 2006 12:27 PM (in response to adrian.brock)container is meant to be a common set of repositories for use by everybody.
The packaging of it in jboss-bean.deployer is purely historical.
I don't understand the other part. If their annotation implements
the JDK5 class Annotation then it can't possibly work in JDK1.4
without some weaving?
I know BIll did some stuff with annotationc that lets you use
interfaces instead of annotations, but since the implementation
is all "generated" code anyway, I don't know why it can't be typesafe? -
10. Re: JBAOP-87 - Annotation Dependencies
bill.burke Jul 16, 2006 5:51 PM (in response to adrian.brock)the interface isn't weaved, the class that is annotated is weaved. (for the jdk1.4 interface replacement of annotations).
-
11. Re: JBAOP-87 - Annotation Dependencies
kabirkhan Jul 18, 2006 9:34 AM (in response to adrian.brock)Yes, the original thinking was to keep allowing simple interfaces to be used as the type for annotation overloads.
But I had to fix some things in JBoss Retro, so the annotations recognized by the annotation helper must now implement org.jboss.lang.Annotation.
If the code is woven from JDK 5 annotation types, the resulting interfaces will implement org.jboss.lang.Annotation. If people want to do this manually or use the old annotation compiler with jdk 1.4 they can still supply an interface, but the interface will need to implement org.jboss.lang.Annotation interface -
12. Re: JBAOP-87 - Annotation Dependencies
kabirkhan Jul 18, 2006 9:39 AM (in response to adrian.brock)BTW I managed to get the microcontainer retroed and all tests passing with jdk 1.4
-
13. Re: JBAOP-87 - Annotation Dependencies
kabirkhan Jul 18, 2006 9:57 AM (in response to adrian.brock)I mean the "container" module :-)
-
14. Re: JBAOP-87 - Annotation Dependencies
kabirkhan Jul 18, 2006 12:53 PM (in response to adrian.brock)I have moved the AnnotationCreator and the things it needs from the aop project into the container project as requested. It lives in org.jboss.annotation.factory.AnnotationCreator