1 22 package org.jboss.aop.deployment; 23 24 import org.jboss.aop.classpool.AOPClassPool; 25 26 import javassist.ClassPool; 27 import javassist.CtClass; 28 import javassist.scopedpool.ScopedClassPoolRepository; 29 30 36 public class TempJBossClassPool extends AOPClassPool 37 { 38 boolean isParentPoolAOP; 39 public TempJBossClassPool(ClassLoader cl, ClassPool src, ScopedClassPoolRepository repository) 40 { 41 super(cl, src, repository); 42 if (src instanceof AOPClassPool) 43 { 44 isParentPoolAOP = true; 45 } 46 } 47 48 public TempJBossClassPool(ClassPool src, ScopedClassPoolRepository repository) 49 { 50 super(src, repository); 51 if (src instanceof AOPClassPool) 52 { 53 isParentPoolAOP = true; 54 } 55 } 56 57 public CtClass getCached(String classname) 58 { 59 CtClass clazz = null; 60 if (isParentPoolAOP) 61 { 62 clazz = ((AOPClassPool)parent).getCached(classname); 63 } 64 if (clazz == null) 65 { 66 clazz = super.getCached(classname); 67 } 68 return clazz; 69 } 70 71 } 72 | Popular Tags |