[jboss-dev-forums] [Design of AOP on JBoss (Aspects/JBoss)] - Re: AOP asintegration WITHOUT the integration :-)

adrian@jboss.org do-not-reply at jboss.com
Tue Sep 4 12:02:06 EDT 2007


"adrian at 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



More information about the jboss-dev-forums mailing list