/** * Defines if the class should be loaded with our class loader. Only if the class starts with * the inspectIT prefix and the class loader trying to load the class is not the * {@value #REFLECTASM_ACCESS_CLASS_LOADER_FQN}. * * @param classLoader * Class loader loading the class (object where the method is executed). * @param className * Name of the class to load. * @return True if we should try to load this with the inspectIT class loader. */ private boolean loadWithInspectItClassLoader(Object classLoader, String className) { return (ClassLoadingUtil.isInspectITClass(className) || ClassLoadingUtil.isOpenTracingClass(className)) && !REFLECTASM_ACCESS_CLASS_LOADER_FQN.equals(classLoader.getClass().getName()); }
/** {@inheritDoc} */ @Override public synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { Class<?> result = findLoadedClass(name); if (null != result) { if (resolve) { resolveClass(result); } return result; } boolean selfFirst = false; if (!ignoreClasses.contains(name)) { if (selfFirstClasses.contains(name) || ClassLoadingUtil.isInspectITClass(name)) { selfFirst = true; } } // Override parent-first behavior into self-first only for specified classes if (selfFirst) { Class<?> c = findClass(name); if (resolve) { resolveClass(c); } return c; } else { return super.loadClass(name, resolve); } }