[jboss-dev-forums] [Design of AOP on JBoss (Aspects/JBoss)] - Re: AOP ClassLoader/Scoping needs thoroughly revising

adrian@jboss.org do-not-reply at jboss.com
Thu Jul 5 10:34:50 EDT 2007


Use case: ClassLoader (really class location) versus deployment scoping

The requirement here is that all deployment situations that should work
will work as expected.

Typically there are three items in the mix
(I'll explain the AOP terminology as well for those readers that are not familiar with it)

1) The class being "modified" (I'll call this the "advised class"), e.g. this would
be Oracle's Connection class
2) The advice (or interceptor if you like) which is the what "modification" you want
to make to the class
3) The configuration, i.e. what are the advices, to which classes do they apply and where in that class they are made (called joinpoints in AOP) 

The use case comes when these are not all in the same deployment or you want
to do different things in different deployments.

e.g. Use Case 1: Different advices in different deployments
Suppose I have Oracle's jdbc jar deployed such that everybody can see the classes
and I want to advise those classes in different ways in different applications

Currently, the advices are linked to the class through what JBoss AOP calls
the advisor. That is every joinpoint has a list of advices (could be no list if the
joinpoint is not advised).

None of those lists can be changed at the deployment level.

There is a notion perJVM, perClass, perInstance, but this is more about
how instances of the advice you get, not what the advice is or does.

e.g. Use Case 2: Different configuration in different deployments
This is similar to use case 1, but the advices are classes that are also globally available.
But the configuration (the -aop.xml) is different in the different deployments.

e.g. Use Case 3: Different advised classes in different deployments
Suppose I deploy different Oracle jars in different applications
and then specify global/local advices and global/local configuration.
This is the kind of thing that will work "out-of-the-box" because
there are multiple versions of the classes to add advisors to.

e.g. Use Case X: Other variants
There are other variants some of which may or may not make sense,
but those that do are probably unlikely to work just by looking at the classloader
of the advised class or advice to determine what configuration to use.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060847#4060847

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060847



More information about the jboss-dev-forums mailing list