|
Juergen, You say, "After all, AOP advice for scripted objects is not supposed to match against the target class in the first place... " I'm new to Spring and AOP. Does this mean that you can't use AOP to wrap a scripted bean in a transaction? In my particular case all of my scripted service beans implement an interface, written in Java and compiled ahead of time. I use the interfaces in my aop:config entry in my xml file. Will my Groovy beans be wrapped in a transaction? Thanks, Mark Dear Mark I think you have misunderstood Juergen comment. Juergen is talking about the source code in the AspectJExpressionPointcut java class."target class" refers to a variable in the source code. If you need to fully understand Juergen comment, you need to read the AspectJExpressionPointcut java class source code. You can use AOP to wrap any scripted bean in a transaction with Juergen fix. I have already tested to wrap a groovy script bean in a transaction with Juergen fix and it passes all the junit tests. The groovy script bean can insert, delete, update, commit and rollback successfully. The fix should be in the next snapshot 20070302. If you want to test before the snapshot is available. You can get the latest AspectJExpressionPointcut.java from the CVS server and compile the spring. Thanks Indeed: Scripted objects can of course be adviced based on their interfaces, with pointcut expressions matching methods defined in those interfaces. The only difference to regular Java classes is that you can't match against the actual target class behind those interfaces (which doesn't even have to exist: scripted objects may implement interface methods as direct method scripts, with no notion of an actual target class). Juergen |
|||||||||||||||||||||||||||||||||||||||||||||
Thanks for pointing this out! I've fixed this through a simple fallback to the proxy method when the ShadowMatch for the target method failed. After all, AOP advice for scripted objects is not supposed to match against the target class in the first place...
This should be available in the next 2.0.3 snapshot.
Juergen