Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Not quite sure on this one, but maybe you need to use a spring managed TestableBean to have spring AOP pick up the method call.</p> <p>edit: of course, you can't use <code>@Around</code> the way that you provided - but this subject has been addressed by another answer, so it's omitted here.</p> <p>edit2: If you need help on how to get a spring managed bean, please feel free to ask. but since you already got your aspect bean set up, I believe you can handle this :)</p> <p>edit3: Hehe. Ok.. maybe not :)</p> <pre><code>ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml"); </code></pre> <p>will load your application context. Load beans from there by calling:</p> <pre><code>TestableBean testableBean = (TestableBean )ctx.getBean("testableBean "); </code></pre> <p>Define the <code>TestableBean</code> just like you did with your Aspect bean.</p> <p>edit4: Now I'm pretty sure that the fault is the non-spring managed bean. </p> <p><code>Use the simplest thing that can work. Spring AOP is simpler than using full AspectJ as there is no requirement to introduce the AspectJ compiler / weaver into your development and build processes. If you only need to advise the execution of operations on Spring beans, then Spring AOP is the right choice. If you need to advise domain objects, or any other object not managed by the Spring container, then you will need to use AspectJ.</code></p> <p>Taken from: <a href="http://static.springsource.org/spring/docs/2.0.x/reference/aop.html" rel="nofollow">http://static.springsource.org/spring/docs/2.0.x/reference/aop.html</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload