Results 1 to 2 of 2

Thread: AOP with AbstractAction execute method

  1. #1

    Unhappy AOP with AbstractAction execute method

    I was attempting to set up an aspect on one of the classes extending AbstractAction (SWF - package org.springframework.webflow.action) on the public final method execute.

    The execute is the only public method in the interface Action class It's signature is: public abstract Event execute(RequestContext requestcontext) throws Exception;

    Now I have tried to define the pointcut in the following ways but it is still not getting invoked.

    (1) @After("execution(* com.tester.SampleAction.*(..))")

    (2) @After("execution(public final org.springframework.webflow.execution.Event org.springframework.webflow.action.AbstractAction. execute(..))")

    (3) @After("execution (public final org.springframework.webflow.execution.Event org.springframework.webflow.action.AbstractAction. *(..))")

    (4) @After("execution (public final * org.springframework.webflow.action.AbstractAction. *(..))")

    The execute method is defined the AbstractAction class.
    I have checked that in my Aspect class other aspects are being correctly invoked. (So there is not configuration issue from spring side). I am using the runtime weaving in Spring for AOP. ( I assume Spring would be using Java dynamic proxy for this internally since an interface exists)

    Please suggest the right pointcut definition?

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,624

    Default

    The first one should match, if you use the AbstractAction you might want to include + sign (meaning any subclass or implementation in case of an interface).

    Also make sure you only have 1 aop:config block not multiple because then you will be proxying proxies which might cause your aspects not to match.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •