From: ahuisky <nu...@jb...> - 2005-05-28 03:24:19
|
| 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.... View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3879330#3879330 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3879330 |