Posts tagged proxy
Pulling the rug from under your feet while keeping standing – Using the Hot Swappable Target Source in Spring AOP
Spring AOP offers a wealth of new options in programming as well as designing Java applications. A somewhat more advanced feature is the Hot Swappable Target Source. The concept of a hot swappable target source is linked to the use of proxies instead of concrete object implementations, which is the heart of standard, run-time JDK based AOP. To advise an object with aspects, such as described in my previous post Getting into Spring AOP – Implementing simple business logic on top of Domain Objects using Aspect Oriented Programming, a proxy is created. This proxy intercepts method calls intended for the underlying target object and applies aspects for all specified pointcuts. Usually the wrapped target object still gets called somewhere in the middle of executing all the aspects that were advised. Note that the code using the proxy is not aware of the fact that it is not using a 'normal' implementation of the interface it is programmed against but instead a proxy. It does not matter for the code; only when you ask for the myobject.getClass() will get quite another classname than you would expect. However myobject instanceof interface will still result in true. Suppose we have More >
Recent Comments