Hi. There is currently no way to do this with AspectJ as far as I know. The problem is that you would have to do real dynamic weaving, i.e. modify your program code on-the-fly, which is simply impossible with current Java technologies, at least on a standard JVM. There are chances to do so with specialized VMs such as Steamloom, however. The only choice you have when using AspectJ is weaving in some predefined aspects and disabling/enabling them at runtime. This of course is not without overhead.
Eric > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:aspectj-users- > [EMAIL PROTECTED] On Behalf Of stalsy > Sent: Sunday, October 01, 2006 1:33 PM > To: aspectj-users@eclipse.org > Subject: [aspectj-users] changing pointcut at runtime > > > Hi all, > > I'm a newbie in aspectj and I need to change a pointcut at runtime > based on the user choice. > > I receive an input String from the user keyboard and I want create a > pointcut based on that input. Initially I've thinking at aspect > reflection, but there isn't any "set" method for this pourpose. > > String comp = InitVars.getFilter(); // get an input from user keyboard > .... > AjType dt = AjTypeSystem.getAjType(DynTrace.class); // the aspect > (DynTrace.aj) in which I would insert new pointcut Pointcut pc = > dt.getPointcut("filter"); // take the old pointcut PointcutExpression > pce = pc.getPointcutExpression(); // take the pointcut old expression > > now how can I insert new pointcut expression( value of variable "comp" > ) in this pointcut? There is another way to make this? > > ES: > > I get the input "component" from user. Than I would change the old > pointcut public pointcut filter(): Scope() && execution(* *(..)); to > public pointcut filter(): Scope() && execution(* component(..)); > > where component in pointcut expression is the value of component > variable. > > someone can help me, please? > > thank you in advance for replies, best regards > -- > View this message in context: http://www.nabble.com/changing-pointcut- > at-runtime-tf2365784.html#a6590719 > Sent from the AspectJ - users mailing list archive at Nabble.com. > > _______________________________________________ > aspectj-users mailing list > aspectj-users@eclipse.org > https://dev.eclipse.org/mailman/listinfo/aspectj-users _______________________________________________ aspectj-users mailing list aspectj-users@eclipse.org https://dev.eclipse.org/mailman/listinfo/aspectj-users