1 27 package ch.ethz.prose.filter; 28 29 import java.util.*; 31 import java.io.*; 32 import ch.ethz.jvmai.JoinPointKinds; 33 import ch.ethz.jvmai.JoinPoint; 34 import ch.ethz.jvmai.CodeJoinPoint; 35 import ch.ethz.prose.engine.JoinPointRequest; 36 import ch.ethz.prose.engine.MethodEntryRequest; 37 import ch.ethz.prose.engine.MethodExitRequest; 38 39 45 public 46 class ExecutionsInSystemClass extends PointCutter implements JoinPointKinds 47 { 48 49 53 public ExecutionsInSystemClass() 54 { 55 acceptMask = MASK_ALL_JP; 56 mayFilterStaticallyMask = MASK_METHOD_ENTRY_JP|MASK_METHOD_EXIT_JP; 57 canFilterStaticallyMask = MASK_METHOD_ENTRY_JP|MASK_METHOD_EXIT_JP; 58 } 59 60 protected boolean doIsSpecialRequest(JoinPointRequest req) 61 { 62 if (req instanceof MethodEntryRequest) 63 return ( (MethodEntryRequest)req).getTargetClass().getClassLoader() == null; 64 65 if (req instanceof MethodEntryRequest) 66 return ( (MethodEntryRequest)req).getTargetClass().getClassLoader() == null; 67 68 throw new Error ("The PointCutter should not allow" + 69 " events other than MASK_METHOD_ENTRY|MASK_METHOD_EXIT"); 70 71 } 72 73 protected boolean doIsSpecialEvent(CodeJoinPoint jp) 74 { 75 return (jp.getMethod().getDeclaringClass().getClassLoader() == null); 76 } 77 } 78 79 80 | Popular Tags |