History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-21651
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Normal Normal
Assignee: Peter Gromov
Reporter: Taras Tielkes
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

spring + aop: this() designator should be aware of declare-parents advice

Created: 25 Sep 07 21:58   Updated: 06 Dec 07 18:43
Component/s: J2EE.Spring
Fix Version/s: Selena 7.0.2

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 7,294
Fixed in build: 7,591


 Description  « Hide
The "declare-parents" type of advice can add additional interface implementations to a bean (a.k.a. "mix-ins").

In Spring AOP, the "this()" designator matches against the type of the AOP proxy.
So, when combining these two features, one can use this() to match mix-in interfaces added by declare-parents:

<aop:config>                                                                                                                                          
  <aop:aspect id="usageTrackerAspect" ref="simpleAspectBean">                                                                                         
    <aop:declare-parents types-matching="foo.bar.aop.SimpleTarget+" implement-interface="foo.bar.aop.MyMixin" 
                         default-impl="foo.bar.aop.MyMixinImpl"/>
    <aop:around pointcut="this(foo.bar.aop.MyMixin)" method="around"/>                                                                                
  </aop:aspect>                                                                                                                                       
</aop:config>

Above example works as expected, but IDEA shows "This advice intercepts no methods".
In practice above example is more often used in "binding form", with the around advice method having a MyMixin m parameter, and using "this(m) as pointcut.



 All   Comments   Work Log   Change History      Sort Order:
Irina Petrovskaya - 12 Nov 07 10:07
checked in 8014