Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ajdt-dev] (no subject)

Hi Vinodh,
 
Your code is a recipe for advice that advises itself, which cause the program to halt
in infinite recursion:
 
 
Try excluding the aspect:
 
  before(): myJsr94Class()  && !within({AdviceType}) { ... }
 
or
 
  before(): myJsr94Class()  && !cflow(within({AdviceType})) { ... }
 
 
Wes
 
P.S. - email subjects help :)
   
 
------------Original Message------------
From: vinodh.t.subbiah@xxxxxxxxxxxx
To: ajdt-dev@xxxxxxxxxxx
Date: Mon, Nov-21-2005 10:20 AM
Subject: [ajdt-dev] (no subject)

Hi all,
 I'm new to AspectJ and I write a point cut for a method as shown

Point Cuts as shown below :

pointcut somecall(): call(* *.executeRules(..)) ;
pointcut myJsr94Class(): somecall() && cflowbelow(somecall()) ;


Before and After advices  :

before(): myJsr94Class() {
                System.out.println("***jsr enter --> "
                                + thisJoinPointStaticPart.getSignature());
        }
        after() returning:myJsr94Class() {
                System.out.println("***jsr enter --> "
                                + thisJoinPointStaticPart.getSignature());
               
        }

It shows this advices in 6 places on my program.But when I run the program Im not able to see the System.out messages.
Can someone tell me am i doing anything wrong here,

Im using RAD 6.0 with AspectJM5



The code which suppose to get advised is below
StatelessRuleSession stateless =
                                (StatelessRuleSession) runtime.createRuleSession(
                                        bindUri,
                                        null,
                                        RuleRuntime.STATELESS_SESSION_TYPE);
Main jsrimpl = new Main();
List objects = new ArrayList();
objects.add(new BREParam("xml_in", jsrimpl.getXMLString(inputFileName)));
stateless.executeRules(objects)                ---------------> Pointcut will advise this line so Im expecting before and after this line to see
                                                                                             the  System out messages


Thanks in advance.
Vinodh
_______________________________________________
ajdt-dev mailing list
ajdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ajdt-dev

Back to the top