public Enumeration<URL> getResources(String name) throws IOException { initialize(name); if(name.startsWith(META_INF_SERVICES)) { // punch in. find the service loader from any module String serviceName = name.substring(META_INF_SERVICES.length()); Vector<URL> urls = new Vector<URL>(); ModulesRegistry reg = module.getRegistry(); for( Module m : reg.getModules() ) urls.addAll(m.getMetadata().getDescriptors(serviceName)); return urls.elements(); } else { // normal look up return super.getResources(name); } }
public Enumeration<URL> getResources(String name) throws IOException { initialize(name); if(name.startsWith(META_INF_SERVICES)) { // punch in. find the service loader from any module String serviceName = name.substring(META_INF_SERVICES.length()); Vector<URL> urls = new Vector<URL>(); ModulesRegistry reg = module.getRegistry(); for( Module m : reg.getModules() ) urls.addAll(m.getMetadata().getDescriptors(serviceName)); return urls.elements(); } else { // normal look up return super.getResources(name); } }
public URL getResource(String name) { initialize(name); if(name.startsWith(META_INF_SERVICES)) { // punch in. find the service loader from any module String serviceName = name.substring(META_INF_SERVICES.length()); ModulesRegistry reg = module.getRegistry(); for( Module m : reg.getModules() ) { List<URL> list = m.getMetadata().getDescriptors(serviceName); if(!list.isEmpty()) return list.get(0); } // no such resource return super.getResource(name); } else { // normal service look up URL url = super.getResource(name); if(url!=null) return url; // commons-logging looks for a class file resource for providers, // so check for those if(name.endsWith(".class")) { String className = name.replace('/', '.').substring(0, name.length() - 6); ModuleImpl m = module.getRegistry().getProvidingModule(className); if(m!=null) return m.getPrivateClassLoader().getResource(name); } return null; } }
public URL getResource(String name) { initialize(name); if(name.startsWith(META_INF_SERVICES)) { // punch in. find the service loader from any module String serviceName = name.substring(META_INF_SERVICES.length()); ModulesRegistry reg = module.getRegistry(); for( Module m : reg.getModules() ) { List<URL> list = m.getMetadata().getDescriptors(serviceName); if(!list.isEmpty()) return list.get(0); } // no such resource return super.getResource(name); } else { // normal service look up URL url = super.getResource(name); if(url!=null) return url; // commons-logging looks for a class file resource for providers, // so check for those if(name.endsWith(".class")) { String className = name.replace('/', '.').substring(0, name.length() - 6); ModuleImpl m = module.getRegistry().getProvidingModule(className); if(m!=null) return m.getPrivateClassLoader().getResource(name); } return null; } }
protected Class<?> findClass(String name) throws ClassNotFoundException { try { return super.findClass(name); } catch (ClassNotFoundException e) { // punch in. find the provider class, no matter where we are. ModuleImpl m = module.getRegistry().getProvidingModule(name); if(m!=null) return m.getPrivateClassLoader().loadClass(name); throw e; } }
protected Class<?> findClass(String name) throws ClassNotFoundException { try { return super.findClass(name); } catch (ClassNotFoundException e) { // punch in. find the provider class, no matter where we are. ModuleImpl m = module.getRegistry().getProvidingModule(name); if(m!=null) return m.getPrivateClassLoader().loadClass(name); throw e; } }