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.AspectManager; 32 import org.jboss.aop.pointcut.Pointcut; 33 34 47 public class JoinpointSimpleClassifier extends JoinpointClassifier 48 { 49 50 58 protected JoinpointClassification classifyJoinpoint(CtMember member, Advisor advisor, Matcher joinpointMatcher) throws NotFoundException 59 { 60 Collection pointcuts = advisor.getManager().getPointcuts().values(); 61 for (Iterator it = pointcuts.iterator(); it.hasNext(); ) 62 { 63 Pointcut pointcut = (Pointcut) it.next(); 64 65 if (joinpointMatcher.matches(pointcut, advisor, member)) 66 { 67 if (AspectManager.verbose) 68 { 69 System.out.println("[debug] " + member + " matches pointcut: " + pointcut.getExpr()); 70 } 71 return JoinpointClassification.WRAPPED; 72 } 73 } 74 if (AspectManager.verbose) 75 { 76 System.out.println("[debug] " + member + " matches no pointcuts"); 77 } 78 return JoinpointClassification.NOT_INSTRUMENTED; 79 } 80 } | Popular Tags |