throws ConfigurationError dPrint("find factoryId =" + factoryId); String systemProp = ss.getSystemProperty(factoryId); if (systemProp != null) { dPrint("found system property, value=" + systemProp); return newInstance(systemProp, null, true); firstTime = false; if (ss.doesFileExist(f)) { dPrint("Read properties file "+f); cacheProps.load(ss.getFileInputStream(f)); dPrint("found in $java.home/jaxp.properties, value=" + factoryClassName); return newInstance(factoryClassName, null, true); Object provider = findJarServiceProvider(factoryId); if (provider != null) { return provider; dPrint("loaded from fallback value: " + fallbackClassName); return newInstance(fallbackClassName, null, true);
Class providerClass = getProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); if (debug) { // Extra check to avoid computing cl strings dPrint("created new instance of " + providerClass + " using ClassLoader: " + cl);
dPrint("found jar resource=" + serviceId + " using ClassLoader: " + cl); dPrint("found in resource, value=" + factoryClassName); return newInstance(factoryClassName, cl, false);
try { return (DocumentBuilderFactory) FactoryFinder.newInstance(factoryClassName, classLoader, false); } catch (FactoryFinder.ConfigurationError e) { throw new FactoryConfigurationError(e.getException(),
return (DocumentBuilderFactory) FactoryFinder.find(
if (debug) dPrint("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance;
if (debug) dPrint("found jar resource=" + serviceId + " using ClassLoader: " + cl); if (debug) dPrint("found in resource, value=" + factoryClassName); return newInstance(factoryClassName, cl, false);
try { return (SAXParserFactory) FactoryFinder.newInstance(factoryClassName, classLoader, false); } catch (FactoryFinder.ConfigurationError e) { throw new FactoryConfigurationError(e.getException(),
return (SAXParserFactory) FactoryFinder.find(
if (debug) dPrint("find factoryId =" + factoryId); if (debug) dPrint("found osgi factory = " + spiClass.getName()); return spiClass.newInstance(); String systemProp = SecuritySupport.getSystemProperty(factoryId); if( systemProp!=null) { if (debug) dPrint("found system property, value=" + systemProp); return newInstance(systemProp, classLoader, true ); firstTime = false; if(SecuritySupport.doesFileExist(f)){ if (debug) dPrint("Read properties file "+f); if (debug) dPrint("found in $java.home/jaxp.properties, value=" + factoryClassName); return newInstance(factoryClassName, classLoader, true); Object provider = findJarServiceProvider(factoryId); if (provider != null) { return provider; if (debug) dPrint("loaded from fallback value: " + fallbackClassName); return newInstance(fallbackClassName, classLoader, true);
/** * @return A new instance of a SAXParserFactory. * * @exception FactoryConfigurationError if the implementation is * not available or cannot be instantiated. */ public static SAXParserFactory newInstance(String factoryClassName, ClassLoader classLoader) { if (factoryClassName == null) { throw new FactoryConfigurationError("factoryClassName cannot be null."); } if (classLoader == null) { classLoader = SecuritySupport.getContextClassLoader(); } try { return (SAXParserFactory) FactoryFinder.newInstance(factoryClassName, classLoader, false); } catch (FactoryFinder.ConfigurationError e) { throw new FactoryConfigurationError(e.getException(), e.getMessage()); } }
return (DocumentBuilderFactory) FactoryFinder.find(
/** * @return New instance of a <code>DocumentBuilderFactory</code> * * @exception FactoryConfigurationError if the implementation is not * available or cannot be instantiated. */ public static DocumentBuilderFactory newInstance(String factoryClassName, ClassLoader classLoader) { if (factoryClassName == null) { throw new FactoryConfigurationError("factoryClassName cannot be null."); } if (classLoader == null) { classLoader = SecuritySupport.getContextClassLoader(); } try { return (DocumentBuilderFactory) FactoryFinder.newInstance(factoryClassName, classLoader, false); } catch (FactoryFinder.ConfigurationError e) { throw new FactoryConfigurationError(e.getException(), e.getMessage()); } }
return (SAXParserFactory) FactoryFinder.find(