[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: DESCRIBE phase - Dependency builders for MC Beans
kabir.khan@jboss.com
do-not-reply at jboss.com
Wed May 13 06:30:22 EDT 2009
"alesj" wrote : What exactly do you mean by "current filters are classname based"?
| You cannot do globing (org.acme.foobar.*) like Adrian suggests?
You can do filtering on classnames, but what if you want to use aop for some instances and not for others?
Also, the current filters are there to turn off loadtime weaving for particular classes, they are not used by the proxies. This was a requirement from about 2 years ago since all "org.jboss." classes are excluded and people had to add their classes to the AspectManager.include attribute to get proxies created for them. There is a forum thread for that, and I'll post it here if I find it.
"alesj" wrote :
| Kabir, what's the current search/matching mechanism?
| Can it be made plugable?
| Or how much would it take to improve that?
|
It is javacc based. Pointcut expressions are broken apart into their class + method/field names and signatures. For every candidate class for weaving /creating a proxy each field/method/constructor is compared against every pointcut (from the bindings). If annotations are used in the pointcut expressions it looks for those in the bytecode for the field/method/constructor and then hits the advisor annotation overrides + metadata.
Changing it would be a big job, but it could be made pluggable. Flavia did some stuff for her masters which we had planned to add to AOP later, which I think should speed this up. I'll let Flavia provide more info on that.
I don't know how easy these will be to do, but here are a few other initial ideas:
-The @DisableAop stuff can be made more fine-grained. It can still disable everything as it does, but since there will be less aop lifecycle bindings than normal bindings and aop lifecycle does not require a proxy and an advisor something like @DisableAop(lifecycle=true) could still check for dependencies for the aop lifecycle stuff and invoke those while avoiding the "real" aop bindings.
-If, for example, the messaging bindings should only be applicable to the messaging classes and not everything else. This would mean including something in the messaging jboss-aop.xml to indicate that these aspects should go into a child aop domain rather than the main aspectmanager, and some way to make sure that the classes would use that child domain. Apart from the bindings between classes and child aop domain, this would be similar to how the aop by scoped classloader stuff works.
-Some annotations could be made always checkable, e.g.
"jason" wrote :
| I do agree that supporting various service annotations is useful
|
| @JBossService
| @interface SomeAnnotation{}
|
and bindings containing pointcut expressions with these annotations are always checked.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4230773#4230773
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4230773
More information about the jboss-dev-forums
mailing list