/** * Check to see if the class is already loaded * * @param name the name of the class * @param trace whether trace is enabled * @return the class is if it is already loaded, null otherwise */ protected Class<?> isLoadedClass(String name, boolean trace) { Class<?> result = findLoadedClass(name); if (result != null) { // Has this classloader been undeployed? ClassLoader otherClassLoader = getClassLoader(result); if (otherClassLoader != null && otherClassLoader != this && otherClassLoader instanceof RealClassLoader) { RealClassLoader rcl = (RealClassLoader) otherClassLoader; // Ignore when undeployed if (rcl.isValid() == false) { if (trace) log.trace(this + " ignoring already loaded class from undeployed classloader " + ClassLoaderUtils.classToString(result)); result = null; } } } if (result != null && trace) log.trace(this + " already loaded class " + ClassLoaderUtils.classToString(result)); return result; }
/** * Check to see if the class is already loaded * * @param name the name of the class * @param trace whether trace is enabled * @return the class is if it is already loaded, null otherwise */ protected Class<?> isLoadedClass(String name, boolean trace) { Class<?> result = findLoadedClass(name); if (result != null) { // Has this classloader been undeployed? ClassLoader otherClassLoader = getClassLoader(result); if (otherClassLoader != null && otherClassLoader != this && otherClassLoader instanceof RealClassLoader) { RealClassLoader rcl = (RealClassLoader) otherClassLoader; // Ignore when undeployed if (rcl.isValid() == false) { if (trace) log.trace(this + " ignoring already loaded class from undeployed classloader " + ClassLoaderUtils.classToString(result)); result = null; } } } if (result != null && trace) log.trace(this + " already loaded class " + ClassLoaderUtils.classToString(result)); return result; }