static <T> T find(Class<T> factoryClass, String defaultClassName, boolean tryFallback) throws SOAPException { return find(factoryClass, defaultClassName, tryFallback, null); }
private static String fromSystemProperty(String factoryId, String deprecatedFactoryId) { String systemProp = getSystemProperty(factoryId); if (systemProp != null) { return systemProp; } if (deprecatedFactoryId != null) { systemProp = getSystemProperty(deprecatedFactoryId); if (systemProp != null) { logger.log(Level.WARNING, "Using non-standard property: {0}. Property {1} should be used instead.", new Object[] {deprecatedFactoryId, factoryId}); return systemProp; } } return null; }
private static String getSystemProperty(final String property) { logger.log(Level.FINE, "Checking system property {0}", property); String value = AccessController.doPrivileged(new PrivilegedAction<String>() { @Override public String run() { return System.getProperty(property); } }); logFound(value); return value; }
String className = fromSystemProperty(factoryId, deprecatedFactoryId); if (className != null) { Object result = newInstance(className, defaultClassName, tccl); if (result != null) { return (T) result; className = fromJDKProperties(factoryId, deprecatedFactoryId); if (className != null) { Object result = newInstance(className, defaultClassName, tccl); if (result != null) { return (T) result; className = fromMetaInfServices(deprecatedFactoryId, tccl); if (className != null) { logger.log(Level.WARNING, "Property {1} should be used instead.", new Object[]{deprecatedFactoryId, factoryId}); Object result = newInstance(className, defaultClassName, tccl); if (result != null) { return (T) result; "Provider for " + factoryId + " cannot be found", null); return (T) newInstance(defaultClassName, defaultClassName, tccl);
Object obj = find(factoryId); if (obj != null) return obj; return newInstance(fallbackClassName, classLoader);
private static String fromJDKProperties(String factoryId, String deprecatedFactoryId) { Path path = null; try { String JAVA_HOME = getSystemProperty("java.home"); path = Paths.get(JAVA_HOME, "conf", "jaxm.properties"); logger.log(Level.FINE, "Checking configuration in {0}", path); logFound(factoryClassName); if (factoryClassName != null) { return factoryClassName; logger.log(Level.FINE, "Checking deprecated property {0}", deprecatedFactoryId); factoryClassName = props.getProperty(deprecatedFactoryId); logFound(factoryClassName); if (factoryClassName != null) { logger.log(Level.WARNING,
classLoader = getContextClassLoader(); } catch (Exception x) { throw new SOAPException(x.toString(), x); System.getProperty( factoryId ); if( systemProp!=null) { return newInstance(systemProp, classLoader); props.load( new FileInputStream(f)); String factoryClassName = props.getProperty(factoryId); return newInstance(factoryClassName, classLoader); return newInstance(factoryClassName, classLoader); return newInstance(factoryClassName, moduleClassLoader);
String factoryClassName = ProviderLocator.lookupByJREPropertyFile("lib" + File.separator + "jaxm.properties", factoryPropertyName); if (factoryClassName != null) { return newInstance(factoryClassName, classLoader); String systemProp = System.getProperty(factoryPropertyName); if (systemProp != null) { return newInstance(systemProp, classLoader); return newInstance(defaultFactoryClassName, classLoader);
String className = fromSystemProperty(factoryId, deprecatedFactoryId); if (className != null) { Object result = newInstance(className, defaultClassName, tccl); if (result != null) { return (T) result; className = fromJDKProperties(factoryId, deprecatedFactoryId); if (className != null) { Object result = newInstance(className, defaultClassName, tccl); if (result != null) { return (T) result; className = fromMetaInfServices(deprecatedFactoryId, tccl); if (className != null) { logger.log(Level.WARNING, "Property {1} should be used instead.", new Object[]{deprecatedFactoryId, factoryId}); Object result = newInstance(className, defaultClassName, tccl); if (result != null) { return (T) result; "Provider for " + factoryId + " cannot be found", null); return (T) newInstance(defaultClassName, defaultClassName, tccl);
Object obj = find(factoryId); if (obj != null) return obj; return newInstance(fallbackClassName, classLoader);
private static String fromJDKProperties(String factoryId, String deprecatedFactoryId) { Path path = null; try { String JAVA_HOME = getSystemProperty("java.home"); path = Paths.get(JAVA_HOME, "conf", "jaxm.properties"); logger.log(Level.FINE, "Checking configuration in {0}", path); logFound(factoryClassName); if (factoryClassName != null) { return factoryClassName; logger.log(Level.FINE, "Checking deprecated property {0}", deprecatedFactoryId); factoryClassName = props.getProperty(deprecatedFactoryId); logFound(factoryClassName); if (factoryClassName != null) { logger.log(Level.WARNING,
classLoader = getContextClassLoader(); } catch (Exception x) { throw new SOAPException(x.toString(), x); System.getProperty( factoryId ); if( systemProp!=null) { return newInstance(systemProp, classLoader); props.load( new FileInputStream(f)); String factoryClassName = props.getProperty(factoryId); return newInstance(factoryClassName, classLoader); return newInstance(factoryClassName, classLoader); return newInstance(factoryClassName, moduleClassLoader);
System.getProperty( factoryId ); if( systemProp!=null) { return newInstance(systemProp, classLoader, defaultClassName); props.load( new FileInputStream(f)); String factoryClassName = props.getProperty(factoryId); return newInstance(factoryClassName, classLoader, defaultClassName); return newInstance(factoryClassName, classLoader, defaultClassName); "Provider for " + factoryId + " cannot be found", null); return newInstance(defaultClassName, classLoader, defaultClassName);
static <T> T find(Class<T> factoryClass, String defaultClassName, boolean tryFallback) throws SOAPException { return find(factoryClass, defaultClassName, tryFallback, null); }
String className = fromSystemProperty(factoryId, deprecatedFactoryId); if (className != null) { Object result = newInstance(className, defaultClassName, tccl); if (result != null) { return (T) result; className = fromJDKProperties(factoryId, deprecatedFactoryId); if (className != null) { Object result = newInstance(className, defaultClassName, tccl); if (result != null) { return (T) result; className = fromMetaInfServices(deprecatedFactoryId, tccl); if (className != null) { logger.log(Level.WARNING, "Property {1} should be used instead.", new Object[]{deprecatedFactoryId, factoryId}); Object result = newInstance(className, defaultClassName, tccl); if (result != null) { return (T) result; "Provider for " + factoryId + " cannot be found", null); return (T) newInstance(defaultClassName, defaultClassName, tccl);
private static String fromJDKProperties(String factoryId, String deprecatedFactoryId) { Path path = null; try { String JAVA_HOME = getSystemProperty("java.home"); path = Paths.get(JAVA_HOME, "conf", "jaxm.properties"); logger.log(Level.FINE, "Checking configuration in {0}", path); logFound(factoryClassName); if (factoryClassName != null) { return factoryClassName; logger.log(Level.FINE, "Checking deprecated property {0}", deprecatedFactoryId); factoryClassName = props.getProperty(deprecatedFactoryId); logFound(factoryClassName); if (factoryClassName != null) { logger.log(Level.WARNING,
private static String getSystemProperty(final String property) { logger.log(Level.FINE, "Checking system property {0}", property); String value = AccessController.doPrivileged(new PrivilegedAction<String>() { @Override public String run() { return System.getProperty(property); } }); logFound(value); return value; }
private static String fromSystemProperty(String factoryId, String deprecatedFactoryId) { String systemProp = getSystemProperty(factoryId); if (systemProp != null) { return systemProp; } if (deprecatedFactoryId != null) { systemProp = getSystemProperty(deprecatedFactoryId); if (systemProp != null) { logger.log(Level.WARNING, "Using non-standard property: {0}. Property {1} should be used instead.", new Object[] {deprecatedFactoryId, factoryId}); return systemProp; } } return null; }
static <T> T find(Class<T> factoryClass, String defaultClassName, boolean tryFallback) throws SOAPException { return find(factoryClass, defaultClassName, tryFallback, null); }
String className = fromSystemProperty(factoryId, deprecatedFactoryId); if (className != null) { Object result = newInstance(className, defaultClassName, tccl); if (result != null) { return (T) result; className = fromJDKProperties(factoryId, deprecatedFactoryId); if (className != null) { Object result = newInstance(className, defaultClassName, tccl); if (result != null) { return (T) result; className = fromMetaInfServices(deprecatedFactoryId, tccl); if (className != null) { logger.log(Level.WARNING, "Property {1} should be used instead.", new Object[]{deprecatedFactoryId, factoryId}); Object result = newInstance(className, defaultClassName, tccl); if (result != null) { return (T) result; "Provider for " + factoryId + " cannot be found", null); return (T) newInstance(defaultClassName, defaultClassName, tccl);