Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] tracing static methods original caller.

Hi Lei Lin,

You might want to take a look at the wormhole pattern in the 'AspectJ
in Action' book. I think that's what you are looking for.

cheers,
 - Gijs Peek

Lei Lin wrote:
> Hi,
>
> I have a problem to trace the static methods original caller. Here is
> the scenario
>
> Class  A has a instance method B, which invokes a static method D of
> Class C. In the method D of C, invoke a static method F of Class E.
> Code likes the below. I use aspect to capture method F calling or
> execution. Assume that there are two instances (U and O) of Class A
> calling the method B in a multi-threads environment.  When the aspect
> captures the method F calling, how can I tell which instance is
> calling method B so that method F is called. Is there a way that I can
> get the object instance of Class A? Thanks a  lot.
>
> Class A
> {
>     methodB
>     {
>           C. methodD;
>     }
> }
>
> Class C
> {
>      static methodD
>      {
>            E.methodF;
>      }
> }
>
> Class E
> {
>      static methodF
>      {
>           .....;
>      }
> }
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users




Back to the top