1 22 package org.jboss.test.aop.mcdefaultannotation; 23 24 import org.jboss.aop.advice.Interceptor; 25 import org.jboss.aop.joinpoint.Invocation; 26 27 32 public class AnnotationReaderInterceptor implements Interceptor 33 { 34 35 public String getName() 36 { 37 return this.getClass().getName(); 38 } 39 40 public Object invoke(Invocation invocation) throws Throwable 41 { 42 TestAnnotation annotation = (TestAnnotation)invocation.resolveClassAnnotation(TestAnnotation.class); 43 String property = annotation.property(); 44 MyBean bean = (MyBean)invocation.getTargetObject(); 45 bean.annValue = property; 46 return invocation.invokeNext(); 47 } 48 49 } 50 | Popular Tags |