Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You don't need to implement Ordered interface. </p> <p>In Spring AOP you can do things much easier. </p> <pre><code>@Aspect @Order(1) public class AspectA { @Before("............") public void doit() {} } @Aspect @Order(2) public class AspectB { @Before(".............") public void doit() {} } </code></pre> <p><strong>Update:</strong></p> <pre><code>@Aspect @Order(1) public class SpringAspect { @Pointcut("within(com.vanilla.service.MyService+)") public void businessLogicMethods(){} @Around("businessLogicMethods()") public Object profile(ProceedingJoinPoint pjp) throws Throwable { System.out.println("running Advice #1"); Object output = pjp.proceed(); return output; } } @Aspect @Order(2) public class SpringAspect2 { @Pointcut("within(com.vanilla.service.MyService+)") public void businessLogicMethods(){} @Around("businessLogicMethods()") public Object profile(ProceedingJoinPoint pjp) throws Throwable { System.out.println("running Advice #2"); Object output = pjp.proceed(); return output; } } </code></pre> <p>Now the application Context Configuration XML:</p> <pre><code>&lt;context:annotation-config /&gt; &lt;aop:aspectj-autoproxy /&gt; &lt;bean id="springAspect" class="com.vanilla.aspect.SpringAspect" /&gt; &lt;bean id="springAspect2" class="com.vanilla.aspect.SpringAspect2" /&gt; </code></pre> <p>You need to enable AOP proxy by:</p> <pre><code>&lt;aop:aspectj-autoproxy /&gt; </code></pre> <p>otherwise no advice will be activated.</p> <p><strong>Update 2:</strong></p> <p>I just make a research on this issue. <code>@order</code> annotation works only on Spring's based proxy AOP (Which I'm using in my example). Accoridng to documentation if you are using weaving you should use declare precedence option.</p> <p><strong>Update 3</strong></p> <ol> <li>I don't see any advices in your code, just aspects and pointcuts.</li> <li>If your Advice classes are: x.y.z.SystemArchitecture</li> </ol> <p>then you need to configure it at as </p> <pre><code>&lt;bean id="systemArchitecture" class="x.y.z.SystemArchitecture" /&gt; </code></pre> <p>and I don't see it in your code. </p> <ol start="3"> <li>"execution (* com.jajah.StorageManager.HomeController.*(..))" what are you targeting on? Can you write it using words? </li> </ol> <p>Anyway. Please drop me a message on facebook and I'll send you working example which does exactly what are you trying to do. </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