/** * 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} containing the stack configuration. * @throws Exception if problems occur during the configuration of the protocol stack. */ public static ProtocolStackConfigurator getStackConfigurator(URL url) throws Exception { checkForNullConfiguration(url); checkJAXPAvailability(); return XmlConfigurator.getInstance(url); }
/** * 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} containing the stack configuration. * @throws Exception if problems occur during the configuration of the protocol stack. */ public static ProtocolStackConfigurator getStackConfigurator(File file) throws Exception { checkJAXPAvailability(); InputStream input=getConfigStream(file); return XmlConfigurator.getInstance(input); }
/** * Returns a protocol stack configurator based on the XML configuration provided by the specified XML element. * * @param element a XML element containing a JGroups XML configuration. * @return a {@code ProtocolStackConfigurator} containing the stack configuration. * @throws Exception if problems occur during the configuration of the protocol stack. */ public static ProtocolStackConfigurator getStackConfigurator(Element element) throws Exception { checkForNullConfiguration(element); return XmlConfigurator.getInstance(element); }
public static ProtocolStackConfigurator getStackConfigurator(InputStream input) throws Exception { return XmlConfigurator.getInstance(input); }
/** * Constructs a JChannel instance with the protocol stack configuration contained by the specified XML element. * @param properties An XML element containing a JGroups XML protocol stack configuration. */ public JChannel(Element properties) throws Exception { this(ConfiguratorFactory.getStackConfigurator(properties)); }
@Override public JChannel createChannel() throws Exception { PlainConfigurator configurator = new PlainConfigurator(properties); return new JChannel(configurator); } }
protected static XmlConfigurator parse(Element root_element) throws Exception { return new XmlConfigurator(parseProtocols(root_element)); }
public String getProtocolString(boolean new_format) { return new_format? getProtocolStringNewXml() : getProtocolString(); }
public String getProtocolStackString() { return getProtocolStackString(false); }
public static XmlConfigurator getInstance(Element el) throws Exception { return parse(el); }
public Map<String, String> getOriginalProperties() throws Exception { Map<String, String> props=new HashMap<>(); parsePropertiesString(props); return props; }
public ProtocolConfiguration(String protocol_name, Map<String,String> properties, ClassLoader loader) { this.protocol_name=protocol_name; this.loader = loader; if(!properties.isEmpty()) { this.properties.putAll(properties); properties_str=propertiesToString(); } }
public Object convert(Object obj, Class<?> propertyFieldType, String propertyName, String prop_val, boolean check_scope) throws Exception { if(prop_val == null) return null; int port_range = getPortRange((Protocol)obj) ; return Util.parseCommaDelimitedHosts(prop_val, port_range); }
public static XmlConfigurator getInstance(URL url) throws java.io.IOException { return getInstance(url, null); }
/** * Constructs a JChannel instance with the protocol stack configuration indicated by the specified URL. * @param properties A URL pointing to a JGroups XML protocol stack configuration. */ public JChannel(URL properties) throws Exception { this(ConfiguratorFactory.getStackConfigurator(properties)); }
public static XmlConfigurator getInstance(InputStream stream, Boolean validate) throws java.io.IOException { return parse(stream, validate); }
public static XmlConfigurator getInstance(InputStream stream) throws java.io.IOException { return getInstance(stream, null); }
/** * Creates a channel with a configuration based on an input stream. * @param input An input stream, pointing to a streamed configuration */ public JChannel(InputStream input) throws Exception { this(ConfiguratorFactory.getStackConfigurator(input)); }
/** * Constructs a JChannel instance with the protocol stack configuration contained in the specified file. * @param file A file containing a JGroups XML protocol stack configuration. */ public JChannel(File file) throws Exception { this(ConfiguratorFactory.getStackConfigurator(file)); }
/** * Constructs a JChannel instance with the protocol stack configuration based upon the specified properties parameter. * @param props A file containing a JGroups XML configuration or a URL pointing to an XML configuration */ public JChannel(String props) throws Exception { this(ConfiguratorFactory.getStackConfigurator(props)); }