1 22 package org.jboss.test.aop.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 34 public class AnnotatedAspectFactory implements AspectFactory 35 { 36 public static final String NAME = "Annotated Aspect Factory"; 37 private static AspectFromFactory aspectCreated = null; 38 39 public Object createPerVM() 40 { 41 aspectCreated = new AspectFromFactory(); 42 return aspectCreated; 43 } 44 45 public Object createPerClass(Advisor advisor) 46 { 47 throw new RuntimeException ("Invalid scope PER_CLASS"); 48 } 49 50 public Object createPerInstance(Advisor advisor, 51 InstanceAdvisor instanceAdvisor) 52 { 53 throw new RuntimeException ("Invalid scope PER_INSTANCE"); 54 } 55 56 public Object createPerJoinpoint(Advisor advisor, Joinpoint jp) 57 { 58 throw new RuntimeException ("Invalid scope PER_JOINPOINT"); 59 } 60 61 public Object createPerJoinpoint(Advisor advisor, 62 InstanceAdvisor instanceAdvisor, Joinpoint jp) 63 { 64 throw new RuntimeException ("Invalid scope PER_JOINPOINT"); 65 } 66 67 public String getName() 68 { 69 return NAME; 70 } 71 72 public static boolean isAspectCreated() 73 { 74 return aspectCreated != null; 75 } 76 77 static AspectFromFactory getAspectCreated() 78 { 79 return aspectCreated; 80 } 81 } | Popular Tags |