|
From: Bryant H. <bry...@ho...> - 2007-10-13 19:40:33
|
Hi,
I had an idea for using annotations to mark various methods in our =
business tier as corresponding to various business events =
(milestones)... ala something like this.
public class MyClass {
public void someMethod() {
method1();
method2();
}
@BusinessMilestone(description=3D"...");
protected void method1() {
...
}
@BusinessMilestone(description=3D"...");
protected void method2() {
...
}
}
The idea is to use the annotations to specify the point cuts where I can =
inject some auditing advice to record these milestones. I thought this =
would be a real quick way for us to specify this sort of thing. My only =
problem is it won't work with any sort of proxying mechanism. If you =
use a proxy, only an external call to 'someMethod' would go through the =
proxy. The internal calls to method1 and method2 (the ones that would =
need interception to apply the advice) won't go through the proxy.
So what I need is not a CGlib proxy, but an actual CGLib enhanced object =
where the point cuts are baked in to my actual object so that I can =
apply the advice.
Is there a way in Spring to accomplish something like this?
Thanks,
Bryant |