/** * Attempts to load the class on the current thread context class loader or * the class loader which loaded us */ protected Class loadClass(String name) throws ClassNotFoundException { ClassLoader beanClassLoader = getBeanDefinitionReader().getBeanClassLoader(); if (beanClassLoader != null) { try { return beanClassLoader.loadClass(name); } catch (ClassNotFoundException e) { } } ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); if (contextClassLoader != null) { try { return contextClassLoader.loadClass(name); } catch (ClassNotFoundException e) { } } return getClass().getClassLoader().loadClass(name); }
/** * Loads the resource from the given URI */ protected InputStream loadResource(String uri) { if (System.getProperty("xbean.dir") != null) { File f = new File(System.getProperty("xbean.dir") + uri); try { return new FileInputStream(f); } catch (FileNotFoundException e) { // Ignore } } // lets try the thread context class loader first InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(uri); if (in == null) { ClassLoader cl = getBeanDefinitionReader().getBeanClassLoader(); if (cl != null) { in = cl.getResourceAsStream(uri); } if (in == null) { in = getClass().getClassLoader().getResourceAsStream(uri); if (in == null) { logger.debug("Could not find resource: " + uri); } } } return in; }
String typeClassName = ele.getAttribute(TYPE_ATTRIBUTE); try { Class typeClass = ClassUtils.forName(typeClassName, this.beanDefinitionReader.getBeanClassLoader()); return new TypedStringValue(value, typeClass);
className, parent, cargs, pvs, getBeanDefinitionReader().getBeanClassLoader());