Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Access the call(Method)

Hi Stefan,

your version should work for static methods. For non-static methods one way to do that is:

public aspect MyAspect
{
    pointcut myPointCut(MyObject targ) :
	call(boolean MyObject.method()) 	
        && target(targ);

    before(MyObject targ): myPointCut(targ)
    {
         targ.otherMethod();
    }
}

Regards,
Simon



hephaistos6@xxxxxx wrote:
Hello,

I think it's a trivial question but I was not able to figure it out myself.

following Code should show what I mean:
----------------------
public aspect MyAspect { pointcut myPointCut: call(boolean MyObject.method()); before(): myPointCut { MyObject.otherMethod(); } } ----------------------

How am I able to call the MyObject.otherMethod() within the "before pointcut"?

Thank you for your answer in advance,
stefan walkner

--
Ein Service von http://www.sms.at

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


--
 AdNovum Informatik AG
 Simon Heinzle
 Praktikant

 Roentgenstrasse 22, CH-8005 Zuerich
 mailto:simon.heinzle@xxxxxxxxxx
 phone: +41 44 272 6111, fax: +41 44 272 6312
 http://www.adnovum.ch

 AdNovum Offices: Bern, Budapest, San Mateo, Zuerich (HQ)


Back to the top