1 22 package org.jboss.test.aop.jdk15.annotated; 23 24 import org.jboss.aop.Advisor; 25 import org.jboss.aop.InstanceAdvisor; 26 import org.jboss.aop.advice.AspectFactory; 27 import org.jboss.aop.joinpoint.Joinpoint; 28 29 33 @org.jboss.aop.InterceptorDef (scope=org.jboss.aop.advice.Scope.PER_VM) 34 @org.jboss.aop.Bind (pointcut="execution(* org.jboss.test.aop.jdk15.annotated.VariaPOJO*->methodWithInterceptorFactory())") 35 public class CountingInterceptorFactory implements AspectFactory 36 { 37 public Object createPerVM() 38 { 39 return new CountingInterceptor(); 40 } 41 42 public Object createPerClass(Advisor advisor) 43 { 44 return new CountingInterceptor(); 45 } 46 47 public Object createPerInstance(Advisor advisor, InstanceAdvisor instanceAdvisor) 48 { 49 return new CountingInterceptor(); 50 } 51 52 public Object createPerJoinpoint(Advisor advisor, Joinpoint jp) 53 { 54 return new CountingInterceptor(); 55 } 56 57 public Object createPerJoinpoint(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp) 58 { 59 return new CountingInterceptor(); 60 } 61 62 public String getName() 63 { 64 return getClass().getName(); 65 } 66 } 67 68 | Popular Tags |