[jboss-dev] jbossas -beans.xml opt

Brian Stansberry brian.stansberry at redhat.com
Wed May 13 15:42:35 EDT 2009


Ales Justin wrote:
>> Should I as a bean developer understand when I need it and when I 
>> don't? (I'm truly asking, although my instinct is that I should.) 
> 
> Yes, you should. And it's not hard to do so.
> 
> To leave out (1) or use (1)'s value you are probably using one of the
> org.jboss.beans.metadata.api.annotations.* annotations in your bean class.
> (or your custom annotation + pluing - like ALR does here: 
> http://exitcondition.alrubinger.com/2008/12/20/doing-two-models-at-the-same-time/) 
> 

Sure, (1) is straightforward and clear.

> 
> To use (2) you are 100% sure you don't wanna aspectize your bean.
> e.g. I'm pretty sure we don't wanna our deployers as AOP proxies
> 

It's that "100% sure" part that's the rub. :) I 100% know how I expect 
my beans to be used. But I could easily be unaware of some subtlety in 
how, for example, the ProfileService management view uses them.

But this quote from your first post sums it up pretty well; I should 
have focused more on it:

>>>>> (2) @org.jboss.aop.microcontainer.annotations.DisableAOP
>>>>>
<snip/>
>>>>>
>>>>> If you use @JMX or anything similar, this should then *not* be used.
>>>>> But for anything else it should be good to use it.

Having a quick look through the beans in the deploy dir, a high % have 
the @JMX annotation declared via xml, and probably many more have it in 
the java code. That's a good argument for needing to @DisableAOP as the 
norm rather than an @EnableAOP.

- Brian



More information about the jboss-development mailing list