1 22 package org.jboss.ejb3.stateful; 23 24 import javax.ejb.Remove ; 25 import org.jboss.aop.Advisor; 26 import org.jboss.aop.InstanceAdvisor; 27 import org.jboss.aop.advice.AspectFactory; 28 import org.jboss.aop.joinpoint.Joinpoint; 29 import org.jboss.aop.joinpoint.MethodJoinpoint; 30 31 36 public class StatefulRemoveFactory implements AspectFactory 37 { 38 public Object createPerVM() 39 { 40 throw new IllegalStateException ("PER_VM NOT APPLICABLE"); 41 } 42 43 public Object createPerClass(Advisor advisor) 44 { 45 throw new IllegalStateException ("PER_CLASS NOT APPLICABLE"); 46 } 47 48 public Object createPerInstance(Advisor advisor, InstanceAdvisor instanceAdvisor) 49 { 50 throw new IllegalStateException ("PER_INSTANCE NOT APPLICABLE"); 51 } 52 53 public Object createPerJoinpoint(Advisor advisor, Joinpoint jp) 54 { 55 Remove rm = (Remove ) advisor.resolveAnnotation(((MethodJoinpoint) jp).getMethod(), Remove .class); 56 return new StatefulRemoveInterceptor(rm.retainIfException()); 57 } 58 59 public Object createPerJoinpoint(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp) 60 { 61 throw new IllegalStateException ("PER_CLASS_JOINPOINT NOT APPLICABLE"); 62 } 63 64 public String getName() 65 { 66 return "StatefulRemoveInterceptor"; 67 } 68 } 69 | Popular Tags |