1 Reply Latest reply on Jun 7, 2005 4:33 AM by Kabir Khan

    helo me!come in!

    andy hui Newbie

       

      public class ServiceRequest{
      //do some thing
      }
      

      public class MyService{
      
      public void method1(ServiceRequest request,String str);
      //many methods that has a ServiceRequest argument
      public Object method2();//none Arguments
      }
      

      public class MyInterceptor implements Interceptor {
      
       public MyInterceptor() {
       super();
       }
      
       public String getName() {
       return "MyInterceptor";
       }
      
       public Object invoke(Invocation invocation) throws Throwable {
       try{
       MethodInvocation mi = (MethodInvocation)invocation;
       ServiceRequest request = (ServiceRequest)mi.getArguments()[0];
       //I get the ServiceRequest,do some thing ...
       return invocation.invokeNext();
       }finally{
       System.out.println("GoodBy,MyInterceptor");
       }
       }
       }
      

      now i want to make MyInterceptor to intercept the methods that has a ServiceRequest argument of MyService !
      how can i write the jboss-aop.xml

      Thanks...very much....