An Introduction to Aspect-Oriented Programming with the Spring Framework, Part 1
Subject:   Automatic Swap of Target Class
Date:   2006-03-30 19:04:31
From:   spidercat
Response to: Automatic Swap of Target Class

Hi Russ
I am attempting to replace ClassA target to ClassB. So the pattern that I am trying to use is (if the package is com.xx), pointcut on com.xx.Class*, anything with Class on their name within the package will be replaced with ClassB. And ClassA is not an interface.

I have used advises via methods,also using interfaces in spring, but for class, I only have seen it in AspectJ.

It seems like jointpoints in spring framework is just limited to methods, and not classes yet. Here is the excerpt from the spring :
"Joinpoint: Point during the execution of a program, such as a method invocation or a particular exception being thrown. In Spring AOP, a joinpoint is always method invocation. Spring does not use the term joinpoint prominently; joinpoint information is accessible through methods on the MethodInvocation argument passed to interceptors, and is evaluated by implementations of the org.springframework.aop.Pointcut interface."

At the moment, I am still looking at the AspectJ document, coz I might just overlooked this.

Thanks for the reply

1 to 1 of 1
  1. Russell Miles photo Automatic Swap of Target Class
    2006-03-31 00:06:31  Russell Miles | O'Reilly AuthorO'Reilly Blogger [View]

    • Automatic Swap of Target Class
      2006-04-06 01:57:53  spidercat [View]

1 to 1 of 1