5 Replies Latest reply on Jun 17, 2005 1:25 PM by oberon777

    Caller pointcuts

    oberon777

      Is there a way to get call site information (line number, etc.) from a CallerInvocation?

      Also is there some sort of a Wrapper interface for getting arguments and the called method/constructor from a CallerInvocation? All sublasses seem to define means for doing so.

      Thanks.
      -Ben

        • 1. Re: Caller pointcuts
          kabirkhan

           

          "oberon777" wrote:
          Is there a way to get call site information (line number, etc.) from a CallerInvocation?

          No

          "oberon777" wrote:
          Also is there some sort of a Wrapper interface for getting arguments and the called method/constructor from a CallerInvocation? All sublasses seem to define means for doing so.


          You need to cast it to the correct subclass (MethodCallefByMethodInvocation etc.) and access the methods from there.


          • 2. Re: Caller pointcuts
            oberon777

            You mean, line # information is never recorded at all?..

            This is a little surprising because I would think that this is not an uncommon requirement to disambiguate based on the call site.

            -Ben

            • 3. Re: Caller pointcuts
              oberon777

              Also, is the situation any different for "callee" pointcuts? It is possible to query the calling method for the line #?

              • 4. Re: Caller pointcuts
                bill.burke

                writing an aspect that depends on line number sounds quite dangerous and eroneous. We will never support it..Sorry...

                • 5. Re: Caller pointcuts
                  oberon777

                  I didn't mean depending on the line number, sorry...

                  I just meant logging the line number for debugging purposes. Anyway, I got it to work using exceptions, which allow one to query the stack trace.