throw new ConfigurationError( "Provider for " + iFactoryId + " cannot be found", null);
throw new ConfigurationError( "Provider for " + iFactoryId + " cannot be found", null);
public Object run() { Method m = null; try { m = Thread.class.getMethod("getContextClassLoader", (Class []) null); } catch (NoSuchMethodException e) { // Assume that we are running JDK 1.1, use the current ClassLoader debugPrintln("assuming JDK 1.1"); return FactoryFinder.class.getClassLoader(); } try { return (ClassLoader) m.invoke(Thread.currentThread(), (Object []) null); } catch (IllegalAccessException e) { // assert(false) throw new ConfigurationError("Unexpected IllegalAccessException", e); } catch (InvocationTargetException e) { // assert(e.getTargetException() instanceof SecurityException) throw new ConfigurationError("Unexpected InvocationTargetException", e); } } }
public Object run() { Method m = null; try { m = Thread.class.getMethod("getContextClassLoader", (Class []) null); } catch (NoSuchMethodException e) { // Assume that we are running JDK 1.1, use the current ClassLoader debugPrintln("assuming JDK 1.1"); return FactoryFinder.class.getClassLoader(); } try { return (ClassLoader) m.invoke(Thread.currentThread(), (Object []) null); } catch (IllegalAccessException e) { // assert(false) throw new ConfigurationError("Unexpected IllegalAccessException", e); } catch (InvocationTargetException e) { // assert(e.getTargetException() instanceof SecurityException) throw new ConfigurationError("Unexpected InvocationTargetException", e); } } }
public Object run() { try { if (iClassLoader != null) { try { return iClassLoader.loadClass(iClassName).newInstance(); } catch (ClassNotFoundException x) { // try again } } return Class.forName(iClassName).newInstance(); } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + iClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + iClassName + " could not be instantiated: " + x, x); } } });
public Object run() { try { return ProviderLocator.loadClass(iClassName, FactoryFinder.class, iClassLoader).newInstance(); } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + iClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + iClassName + " could not be instantiated: " + x, x); } } });