Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Re: how to write an Aspect for the inheritance architecture of target.

Just for clarifying:

public class WS1 {
   public void m1() {
      System.out.println("in WS1.m1()");
   }

   public void m2() {
      System.out.println("in WS1.m2()");
   }
}

public class WS2 {
   public void m3() {
      System.out.println("in WS2.m3()");
   }

   public void m4() {
      System.out.println("in WS2.m4()");
   }
}

I want to track the number of invocation of each method in WS1 and WS2 ...




pzgyuanf wrote:

Hi all,
I'm a newcomer of Aspect, so forgive me for my unaware basical problem.

I want to count Web Service methods call, such as how many number of call to one WS method in last 5 minutes?
and there's many Web Service, each of which has many WSmethod.
And I want to write just one Aspect to serve all.

I can only use java annotation and spring's support.

[quoting from AspectJ]
/The 1.5.0 release of AspectJ 5 does not support annotation style declarations for declare parents ... extends and declare soft (programs with these declarations would not in general be compilable by a regular Java 5 compiler, reducing the priority of their implementation). These may be supported in a future release./

/ Declare annotation is also not supported in the 1.5.0 release of AspectJ 5./


So whether there is a workaround to judge which method is calling? and in which web service method instead of using instanceof or use String.equal() as the boolean condition in if/elseif/else?


appreciate your help.

-P



Back to the top