[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[ajdt-dev] cflow Below problem
|
hello all,
sorry for the off-topic question, i was 'blamed' alredy once,..
this time i have read aspectj guide and try to implement an advice properly
but i cant get it to work.., mayb because i don't understand properly the cflowBelow
here's situation
MyBean1 {
public void deleteObject() {
MyBean2.deleteMethod2();
}
..
}
MyBean2 {
public void deleteMethod2() {
checkStatus();
}
private void checkStatus() {
..
}
}
what i wanted to do was that, if the MYBean2.checkStatus() is called in the flow
of MYBean1.deleteObject
() the method should not execute....
here's my Aspect
public aspect TestAspect {
pointcut deleteObject() :
execution(* com.MyBean1.deleteObject(..));
pointcut checkReplenishment() :
execution(* com.MyBean2.checkStatus(..));
void around() {
(cflow(deleteObject()) && checkStatus()) {
System.err.println("Pointcut intercepted!!!!..");
return;
}
since it is not executing, in my opinion the problem is that i have to intercept the call to MyBean2 in the flow of
MyBean1.deleteObject, and i have to intercept the call to MYBean.checkStatus() in the cflow of
MyBean2.deleteMethod2()
anyone could comment?
thans in advance and regards
marco