How will we configure Aspects? Here's what I've come up with. I'll talk in XML first then walk you through it.
<class-metadata name="somedata" group="transaction" class="com.mycom.MyClass">
Ok for this example I'm describing the EJB transaction attributes for the com.mycom.MyClass class. The default value is "supports" this is defined at the class level. Then, every "get" method overrides the default to be RequiresNew. Now, any tag under or will be considered the attribute name, for example.
<class-metadata name="id2" group="cache" class="com.mycom.MyClass">
Ok, next concept is, how to resolve metadata/config info? The first scenario is, what if there is no <class-metadata> defined for a given class? For this I'll have a <default-metadata> construct.
So if there is no class-metadata defined then the value is resolved through <default-metadata>.
Ok, let's take this concept of resolving a step further. Next, there will be different levels that metadata can be overriden. In summary:
Let's give examples of each one:
Advised aspected = (Advised)someobj;
aspected._getAdvisor().nextInvocationOverride("transaction", "transattribute", "NotSupported");
In this example, the developer states that the next invocation will override the transattribute for the duration of the invocation and no longer.
Advisor.overrideThread("logging", "logginglevel", "debug");
In this example, any invocations on any aspected objects will have the "loggin", "logginglevel" set to debug for this thread and only this thread.
Hopefully, I'm making sense. In the future, we will get funkier with the "default-metadata". Like setting up your own chains there. class->default(application->JVM->cluster).