public static Properties loadAllProperties(String resourceName, ClassLoader classLoader, Logger logger, Level level, String msg) throws IOException { Properties properties = new Properties(); // Set default class loader if neccessary if (classLoader == null) { classLoader = PropertiesLoaderUtils.class.getClassLoader(); } Enumeration<URL> urls = classLoader.getResources(resourceName); while (urls.hasMoreElements()) { URL url = urls.nextElement(); if (logger != null) { logger.log(level, msg, url.toString()); } try (InputStream is = url.openStream()) { properties.loadFromXML(new BufferedInputStream(is)); } } return properties; }
public static Properties loadAllProperties(String resourceName, ClassLoader classLoader, Logger logger, Level level, String msg) throws IOException { Properties properties = new Properties(); // Set default class loader if neccessary if (classLoader == null) { classLoader = PropertiesLoaderUtils.class.getClassLoader(); } Enumeration<URL> urls = classLoader.getResources(resourceName); while (urls.hasMoreElements()) { URL url = urls.nextElement(); if (logger != null) { logger.log(level, msg, url.toString()); } try (InputStream is = url.openStream()) { properties.loadFromXML(new BufferedInputStream(is)); } } return properties; }
public static Properties loadAllProperties(String resourceName, ClassLoader classLoader, Logger logger, Level level, String msg) throws IOException { Properties properties = new Properties(); Enumeration<URL> urls = classLoader.getResources(resourceName); while (urls.hasMoreElements()) { URL url = urls.nextElement(); if (logger != null) { logger.log(level, msg, url.toString()); } InputStream is = null; try { is = url.openStream(); properties.loadFromXML(new BufferedInputStream(is)); } finally { if (is != null) { is.close(); } } } return properties; }
public static Properties loadAllProperties(String resourceName, ClassLoader classLoader, Logger logger, Level level, String msg) throws IOException { Properties properties = new Properties(); // Set default class loader if neccessary if (classLoader == null) { classLoader = PropertiesLoaderUtils.class.getClassLoader(); } Enumeration<URL> urls = classLoader.getResources(resourceName); while (urls.hasMoreElements()) { URL url = urls.nextElement(); if (logger != null) { logger.log(level, msg, url.toString()); } InputStream is = null; try { is = url.openStream(); properties.loadFromXML(new BufferedInputStream(is)); } finally { if (is != null) { is.close(); } } } return properties; }
public static Properties loadAllProperties(String resourceName, ClassLoader classLoader, Logger logger, Level level, String msg) throws IOException { Properties properties = new Properties(); // Set default class loader if neccessary if (classLoader == null) { classLoader = PropertiesLoaderUtils.class.getClassLoader(); } Enumeration<URL> urls = classLoader.getResources(resourceName); while (urls.hasMoreElements()) { URL url = urls.nextElement(); if (logger != null) { logger.log(level, msg, url.toString()); } InputStream is = null; try { is = url.openStream(); properties.loadFromXML(new BufferedInputStream(is)); } finally { if (is != null) { is.close(); } } } return properties; }
private void registerWSDLExtensibilityPlugins(ExtensionRegistry registry) { Properties initialExtensions = null; try { initialExtensions = PropertiesLoaderUtils.loadAllProperties(WSDL_PLUGIN_RESOURCE, Thread .currentThread().getContextClassLoader()); } catch (IOException ex) { throw new RuntimeException(ex); } for (Iterator<?> it = initialExtensions.keySet().iterator(); it.hasNext();) { String key = (String) it.next(); String pluginClz = initialExtensions.getProperty(key); try { if (LOG.isLoggable(Level.FINE)) { LOG.fine("Registering : " + pluginClz + " for type: " + key); } WSDLExtensibilityPlugin plugin = (WSDLExtensibilityPlugin)ClassLoaderUtils.loadClass(pluginClz, getClass()). newInstance(); plugin.setExtensionRegistry(registry); wsdlPlugins.put(key, plugin); } catch (Exception ex) { LOG.log(Level.WARNING, "EXTENSION_ADD_FAILED_MSG", ex); } } } }
initialExtensions = PropertiesLoaderUtils.loadAllProperties(SERVICE_VALIDATOR, Thread .currentThread().getContextClassLoader()); } catch (IOException ex) {
public List<ServiceValidator> getServiceValidators() { List<ServiceValidator> validators = new ArrayList<>(); Properties initialExtensions = null; try { initialExtensions = PropertiesLoaderUtils.loadAllProperties(SERVICE_VALIDATOR, Thread .currentThread().getContextClassLoader()); } catch (IOException ex) { throw new RuntimeException(ex); } for (Iterator<?> it = initialExtensions.values().iterator(); it.hasNext();) { String validatorClass = (String)it.next(); try { if (LOG.isLoggable(Level.FINE)) { LOG.fine("Found service validator : " + validatorClass); } ServiceValidator validator = (ServiceValidator)Class.forName( validatorClass, true, Thread.currentThread() .getContextClassLoader()) .newInstance(); validators.add(validator); } catch (Exception ex) { LOG.log(Level.WARNING, "EXTENSION_ADD_FAILED_MSG", ex); } } return validators; }
private void registerWSDLExtensibilityPlugins(ExtensionRegistry registry) { Properties initialExtensions = null; try { initialExtensions = PropertiesLoaderUtils.loadAllProperties(WSDL_PLUGIN_RESOURCE, Thread .currentThread().getContextClassLoader()); } catch (IOException ex) { throw new RuntimeException(ex); } for (Iterator<?> it = initialExtensions.keySet().iterator(); it.hasNext();) { String key = (String) it.next(); String pluginClz = initialExtensions.getProperty(key); try { if (LOG.isLoggable(Level.FINE)) { LOG.fine("Registering : " + pluginClz + " for type: " + key); } WSDLExtensibilityPlugin plugin = (WSDLExtensibilityPlugin)ClassLoaderUtils.loadClass(pluginClz, getClass()). newInstance(); plugin.setExtensionRegistry(registry); wsdlPlugins.put(key, plugin); } catch (Exception ex) { LOG.log(Level.WARNING, "EXTENSION_ADD_FAILED_MSG", ex); } } } }
public List<ServiceValidator> getServiceValidators() { List<ServiceValidator> validators = new ArrayList<>(); Properties initialExtensions = null; try { initialExtensions = PropertiesLoaderUtils.loadAllProperties(SERVICE_VALIDATOR, Thread .currentThread().getContextClassLoader()); } catch (IOException ex) { throw new RuntimeException(ex); } for (Iterator<?> it = initialExtensions.values().iterator(); it.hasNext();) { String validatorClass = (String)it.next(); try { if (LOG.isLoggable(Level.FINE)) { LOG.fine("Found service validator : " + validatorClass); } ServiceValidator validator = (ServiceValidator)Class.forName( validatorClass, true, Thread.currentThread() .getContextClassLoader()) .newInstance(); validators.add(validator); } catch (Exception ex) { LOG.log(Level.WARNING, "EXTENSION_ADD_FAILED_MSG", ex); } } return validators; }
private void registerWSDLExtensibilityPlugins(ExtensionRegistry registry) { Properties initialExtensions = null; try { initialExtensions = PropertiesLoaderUtils.loadAllProperties(WSDL_PLUGIN_RESOURCE, Thread .currentThread().getContextClassLoader()); } catch (IOException ex) { throw new RuntimeException(ex); } for (Iterator<?> it = initialExtensions.keySet().iterator(); it.hasNext();) { String key = (String) it.next(); String pluginClz = initialExtensions.getProperty(key); try { if (LOG.isLoggable(Level.FINE)) { LOG.fine("Registering : " + pluginClz + " for type: " + key); } WSDLExtensibilityPlugin plugin = (WSDLExtensibilityPlugin)ClassLoaderUtils.loadClass(pluginClz, getClass()). newInstance(); plugin.setExtensionRegistry(registry); wsdlPlugins.put(key, plugin); } catch (Exception ex) { LOG.log(Level.WARNING, "EXTENSION_ADD_FAILED_MSG", ex); } } } }
private void registerWSDLExtensibilityPlugins(ExtensionRegistry registry) { Properties initialExtensions = null; try { initialExtensions = PropertiesLoaderUtils.loadAllProperties(WSDL_PLUGIN_RESOURCE, Thread .currentThread().getContextClassLoader()); } catch (IOException ex) { throw new RuntimeException(ex); } for (Iterator<?> it = initialExtensions.keySet().iterator(); it.hasNext();) { String key = (String) it.next(); String pluginClz = initialExtensions.getProperty(key); try { if (LOG.isLoggable(Level.FINE)) { LOG.fine("Registering : " + pluginClz + " for type: " + key); } WSDLExtensibilityPlugin plugin = (WSDLExtensibilityPlugin)ClassLoaderUtils.loadClass(pluginClz, getClass()). newInstance(); plugin.setExtensionRegistry(registry); wsdlPlugins.put(key, plugin); } catch (Exception ex) { LOG.log(Level.WARNING, "EXTENSION_ADD_FAILED_MSG", ex); } } } }
initialExtensions = PropertiesLoaderUtils.loadAllProperties(resource, cl); initialExtensions = PropertiesLoaderUtils.loadAllProperties(resource, Thread.currentThread().getContextClassLoader());
initialExtensions = PropertiesLoaderUtils.loadAllProperties(resource, cl); initialExtensions = PropertiesLoaderUtils.loadAllProperties(resource, Thread.currentThread().getContextClassLoader());