1 22 package org.jboss.test.aop.basic; 23 24 import org.jboss.aop.advice.Interceptor; 25 import org.jboss.aop.joinpoint.Invocation; 26 27 31 public class POJOConstructorInterceptor implements Interceptor 32 { 33 34 public String getName() 35 { 36 return "POJOConstructorInterceptor"; 37 } 38 39 public Object invoke(Invocation invocation) throws Throwable 40 { 41 Object rtn = invocation.invokeNext(); 42 POJOConstructorTest pojo = (POJOConstructorTest) rtn; 43 String data = (String ) invocation.getMetaData("test", "data"); 44 System.out.println("POJOConstructorInterceptor's data is: " + data); 45 pojo.data = data; 46 return pojo; 47 } 48 49 } 50 51 | Popular Tags |