1 22 package org.jboss.test.aop.bean; 23 24 import org.jboss.aop.advice.Interceptor; 25 import org.jboss.aop.joinpoint.Invocation; 26 import org.jboss.aop.joinpoint.MethodInvocation; 27 import org.jboss.aop.joinpoint.ConstructorInvocation; 28 29 import java.lang.reflect.Method ; 30 35 public class POJOConstructorInterceptor implements Interceptor 36 { 37 38 public String getName() 39 { 40 return "POJOConstructorInterceptor"; 41 } 42 43 public Object invoke(Invocation invocation) throws Throwable 44 { 45 Object rtn = invocation.invokeNext(); 46 POJOConstructorTest pojo = (POJOConstructorTest)rtn; 47 String data = (String )invocation.getMetaData("test", "data"); 48 pojo.data = data; 49 return pojo; 50 } 51 52 } 53 54 | Popular Tags |