[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
[aspectj-users] Circular advice precedence and same Advice class
|
- From: Dan Becker <dan.o.becker@xxxxxxxxx>
- Date: Thu, 16 Jul 2009 12:33:02 -0500
- Delivered-to: aspectj-users@eclipse.org
- User-agent: Thunderbird 2.0.0.22 (Windows/20090605)
How does one get rid the circular advice precedence error when the
pointcut points to a single method, and the concrete-aspect comes from a
single Advice class?
The error:
"error at myPath\ProfilingAbstractAspect.java::0 circular advice
precedence: can't determine precedence between two or more pieces of
advice that apply to the same join point"
The advice class:
@Aspect
public abstract class ProfilingAbstractAspect {
@Pointcut
public abstract void beforeScope();
@Pointcut
public abstract void afterScope();
@Pointcut
public abstract void aroundScope();
@Before("beforeScope()")
public void beginProfile(JoinPoint jp) {
...
}
@After("afterScope()")
public void afterProfile() {
...
}
@Around("aroundScope()")
public Object aroundProfile(ProceedingJoinPoint pjp) throws Throwable {
...
}
}
The aop.xml definition of concrete aspects and join point:
<aspects>
<concrete-aspect name="myPath.ProfilingServlet"
extends="myPath.ProfilingAbstractAspect">
<pointcut name="beforeScope" expression="execution(*
myPath.Servlet.doService(..))"
precedence="myPath.ProfilingAbstractAspect,*"/>
<pointcut name="afterScope" expression="execution(*
myPath.Servlet.doService(..))"
precedence="myPath.ProfilingAbstractAspect,*"/>
<pointcut name="aroundScope" expression="execution(*
myPath.Servlet.doService(..))"
precedence="myPath.ProfilingAbstractAspect,*"/>
</concrete-aspect>
</aspects>
--
Thanks, Dan