public static InputStream getConfigStream(File file) throws Exception { if(propertiesOverride != null) return getConfigStream(propertiesOverride); checkForNullConfiguration(file); try { return new FileInputStream(file); } catch(IOException ioe) { throw createChannelConfigurationException(ioe); } }
public static InputStream getConfigStream(URL url) throws Exception { if (propertiesOverride != null) return getConfigStream(propertiesOverride); try { checkJAXPAvailability(); return url.openStream(); } catch(Exception ex) { throw createChannelConfigurationException(ex); } }
/** * Returns a protocol stack configurator based on the XML configuration * provided by the specified File. * * @param file a File with a JGroups XML configuration. * * @return a <code>ProtocolStackConfigurator</code> containing the stack * configuration. * * @throws ChannelException if problems occur during the configuration of * the protocol stack. */ public static ProtocolStackConfigurator getStackConfigurator(File file) throws ChannelException { ProtocolStackConfigurator returnValue; if (propertiesOverride != null) { returnValue = getStackConfigurator(propertiesOverride); } else { try { checkJAXPAvailability(); InputStream input=getConfigStream(file); returnValue=XmlConfigurator.getInstance(input); } catch(Exception ex) { throw createChannelConfigurationException(ex); } } return returnValue; }
/** * Returns a protocol stack configurator based on the XML configuration * provided at the specified URL. * * @param url a URL pointing to a JGroups XML configuration. * * @return a <code>ProtocolStackConfigurator</code> containing the stack * configuration. * * @throws ChannelException if problems occur during the configuration of * the protocol stack. */ public static ProtocolStackConfigurator getStackConfigurator(URL url) throws ChannelException { ProtocolStackConfigurator returnValue; if (propertiesOverride != null) { returnValue = getStackConfigurator(propertiesOverride); } else { checkForNullConfiguration(url); checkJAXPAvailability(); try { returnValue=XmlConfigurator.getInstance(url); } catch (IOException ioe) { throw createChannelConfigurationException(ioe); } } return returnValue; }