1 22 package org.jboss.aop.instrument; 23 24 import java.util.Collection ; 25 import java.util.Iterator ; 26 27 import javassist.CtMember; 28 import javassist.NotFoundException; 29 30 import org.jboss.aop.Advisor; 31 import org.jboss.aop.pointcut.Pointcut; 32 import org.jboss.aop.pointcut.PointcutInfo; 33 34 43 public class JoinpointFullClassifier extends JoinpointClassifier 44 { 45 58 protected JoinpointClassification classifyJoinpoint(CtMember member, Advisor advisor, Matcher joinpointMatcher) throws NotFoundException 59 { 60 JoinpointClassification classification = JoinpointClassification.NOT_INSTRUMENTED; 61 Collection pointcuts = advisor.getManager().getPointcutInfos().values(); 62 boolean dynamicAop = true; 63 for (Iterator it = pointcuts.iterator(); it.hasNext(); ) 64 { 65 PointcutInfo pointcutInfo = (PointcutInfo) it.next(); 66 if (classification == JoinpointClassification.PREPARED && pointcutInfo.getBinding() == null) 68 { 69 continue; 70 } 71 Pointcut pointcut = pointcutInfo.getPointcut(); 72 if (joinpointMatcher.matches(pointcut, advisor, member)) { 73 if (pointcutInfo.getBinding() == null) 75 { 76 classification = JoinpointClassification.PREPARED; 77 } 78 else if (pointcutInfo.isDynamicAop()) 79 { 80 classification = JoinpointClassification.DYNAMICALY_WRAPPED; 81 } 82 else 83 { 84 classification = JoinpointClassification.WRAPPED; 85 break; 87 } 88 } 89 } 90 return classification; 91 } 92 } | Popular Tags |