[jboss-dev] jbossas -beans.xml opt

David M. Lloyd david.lloyd at redhat.com
Wed May 13 13:39:41 EDT 2009


That sounds like a good idea.  Consider also the growing number of bean 
declarations that are currently created programmatically by other deployers 
- most (maybe all) of these would have to be refitted to add these 
annotations.  Better to keep the defaults to the common case if possible.

- DML

On 05/13/2009 12:23 PM, Brian Stansberry wrote:
> How about a hypothetical:
> 
> (3) @org.jboss.aop.microcontainer.annotations.EnableAOP
> 
> and fall back to plain POJO handling by default.
> 
> Ales Justin wrote:
>> I'm looking for volunteers or the people responsible for the existing 
>> -jboss-beans.xml files in jbossas. :-)
>>
>> The reason is a new way to optimize boot time a bit.
>> We have two new annotations we can add to our beans.
>>
>> (1) @org.jboss.beans.metadata.api.annotations.MCAnnotations
>>
>> This one takes two attributes:
>> (a) Class<? extends Annotation>[] value() default {};
>> (b) boolean ignore() default false
>>
>> With (a) you can provide a set of annotation classes that might be 
>> used on your bean/class to use MC's IoC.
>> e.g. @org.jboss.beans.metadata.api.annotations.Inject
>> Only matching plugins will be then used, instead of all.
>>
>> With (b) you can simply say ignore any @annotation MC IoC lookup.
>> This is probably mostly true for all beans.
>>
>> (2) @org.jboss.aop.microcontainer.annotations.DisableAOP
>>
>> This one instructs MC to ignore transparent AOP usage when handling 
>> your bean.
>> It will not look for aspect dependencies or try to create an AOP proxy.
>> It will simply fall back to plain POJO handling.
>>
>> If you use @JMX or anything similar, this should then *not* be used.
>> But for anything else it should be good to use it.
>>
>> How to use this?
>> (a) either annotate your service/bean classes
>> (b) simply use xml way of annotating your beans
>>
>> e.g. 
>> <annotation>@org.jboss.beans.metadata.api.annotations.MCAnnotations({org.jboss.beans.metadata.api.annotations.Inject.class})</annotation> 
>>
>> <annotation>@org.jboss.aop.microcontainer.annotations.DisableAOP</annotation> 
>>
>>
>> (c) if you know that none of your beans in <deployment> (-beans.xml 
>> file) uses any of the needed features,
>> you can simply add xml way to the <deployment> element.
>> This way all beans inherit the annotation from deployment.
>>
>> So, let's get busy "annotating" those jbossas beans. ;-)
>>
>> ps: how should we proceed with this? :-)
>> _______________________________________________
>> jboss-development mailing list
>> jboss-development at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/jboss-development
> 
> 



More information about the jboss-development mailing list