1 22 package org.jboss.test.aop.basic; 23 24 import org.jboss.aop.advice.Interceptor; 25 import org.jboss.aop.joinpoint.Invocation; 26 import org.jboss.aop.joinpoint.MethodInvocation; 27 28 32 public class POJOMethodInterceptor implements Interceptor 33 { 34 35 public String getName() 36 { 37 return "POJOMethodInterceptor"; 38 } 39 40 public Object invoke(Invocation invocation) throws Throwable 41 { 42 Object rtn = invocation.invokeNext(); 43 wasHit = true; 44 MethodInvocation m = (MethodInvocation) invocation; 45 POJOConstructorTest pojo = (POJOConstructorTest) m.getTargetObject(); 46 String data = (String ) invocation.getMetaData("test", "data"); 47 pojo.data = data; 48 return rtn; 49 } 50 51 public static boolean wasHit = false; 52 53 } 54 55 | Popular Tags |