[Design of AOP on JBoss (Aspects/JBoss)] - Re: AOP asintegration WITHOUT the integration :-)
by adrian@jboss.org
"adrian(a)jboss.org" wrote :
| My preferred solution to use the scopes. i.e. you can choose
| to deploy aop config at the SERVER, SUBSYSTEM, APPLICATION level, etc.
| but this requires doing a lot work fixing everything to make sure
| it sets the correct thread local MetaData for AOP to know which Scope
| applies at runtime.
|
This thead local is really just a generalization of ejbs/mbeans
setting the correct context classloader and java:/comp/env
In principle once this is done. The only work required by AOP
would be for the deployer to create hierarchical (same hierarchy as the scopes)
AOP Domains in the DeploymentUnit.get{Mutable}MetaData()
and deploy config into the correct scoped domain
The caveat being that it should be possible to override the scope,
e.g. a deployment could choose to deploy the aop confg into the global
SERVER scope or the EJB3 SUBSYSTEM scope.
At runtime all AOP has to do is:
| MetaData metadata = MetaDataStack.peek();
| AspectManager manager = metadata.getMetaData(AspectManager.class);
|
which will retrieve the scoped AOP domain if there is aop config at
the APPLICATION/SUBSYSTEM/etc.
or the default AspectManager at the SERVER level if there isn't.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4080966#4080966
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4080966
17 years, 1 month
[Design of AOP on JBoss (Aspects/JBoss)] - Re: AOP asintegration WITHOUT the integration :-)
by adrian@jboss.org
To reproduce all the OSGi rules and old JBoss rules you would need
to look at the classloading rules and create AOP Domains that delegate to each other.
Think of A1, A2 and Support1/2 as applications. They are the
same application(s) deployed multiple times
(possibly different versions of the classes or just so the user can get their own singletons).
The AOPDeployer could use the classloading config and create domains
to match. i.e. A1 can see AOP configuration from A1 and Support1
For the old JBoss rules (importAll=true) then the visibilty would depend on the
domain name and parent policy like the old ScopedDomain.
The real work is going on in the "incomplete"
org.jboss.deployers.plugins.classloading.Module.
My preferred solution to use the scopes. i.e. you can choose
to deploy aop config at the SERVER, SUBSYSTEM, APPLICATION level, etc.
but this requires doing a lot work fixing everything to make sure
it sets the correct thread local MetaData for AOP to know which Scope
applies at runtime.
i.e. somebody could apply default aop config for some interception
at the server/global level and an application could override it.
Which AOP config applies when creating the object depends on the context of the
invocation NOT what classloader loads the aspect
(which could be in a different/global deployment) or the intercepted class (same reason)
to the application doing the work.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4080956#4080956
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4080956
17 years, 1 month
[Design of AOP on JBoss (Aspects/JBoss)] - Re: AOP asintegration WITHOUT the integration :-)
by kabir.khan@jboss.com
With the multiple versions test-case, we are basically deploying two similar jboss-aop.xml files into the system. One goes into A1, the other into A2
| |---- Support1 -- A1
| MOCK-
| |---- Support2 -- A2
|
I am not clear on what the visibility rules for resources are between the classloaders? Currently everything gets applied everywhere (in other words both in A1 and A2 we will get intercepted by TestInterceptor twice)
while it feels more natural that the jboss-aop.xml that is deployed into A1 only applies there, while the one that is depoyed into A2 only applies there. This is what the domains made easy :-) Of course we had the opposite case using the global domain where everything is deployed/visible everywhere. I guess I am trying to define this "partial" visiblity somehow wrt to the -aop.xml information.
Or should I not really care about this unless there is a "real" scope, i.e child domains, and just make sure that the AspectDefinitions have some indexing by classloader like you suggest?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4080934#4080934
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4080934
17 years, 1 month