Package org.jgroups.conf
Class ConfiguratorFactory
java.lang.Object
org.jgroups.conf.ConfiguratorFactory
The ConfigurationFactory is a factory that returns a protocol stack configurator.
The protocol stack configurator is an object that read a stack configuration and
parses it so that the ProtocolStack can create a stack.
Currently the factory returns one of the following objects:
1. XmlConfigurator - parses XML files
2. PlainConfigurator - uses the old style strings UDP:FRAG: etc etc
Currently the factory returns one of the following objects:
1. XmlConfigurator - parses XML files
2. PlainConfigurator - uses the old style strings UDP:FRAG: etc etc
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static voidChecks the availability of the JAXP classes on the classpath.static InputStreamgetConfigStream(File file) static InputStreamgetConfigStream(Object properties) static InputStreamgetConfigStream(String properties) Returns a JGroups XML configuration InputStream based on the provided properties string.static ProtocolStackConfiguratorgetStackConfigurator(File file) Returns a protocol stack configurator based on the XML configuration provided by the specified File.static ProtocolStackConfiguratorgetStackConfigurator(InputStream input) static ProtocolStackConfiguratorgetStackConfigurator(String properties) Returns a protocol stack configurator based on the provided properties string.(package private) static XmlConfiguratorgetXmlConfigurator(String properties) Returns an XmlConfigurator based on the provided properties string (if possible).
-
Field Details
-
JAXP_MISSING_ERROR_MSG
- See Also:
-
-
Constructor Details
-
ConfiguratorFactory
protected ConfiguratorFactory()
-
-
Method Details
-
getStackConfigurator
Returns a protocol stack configurator based on the XML configuration provided by the specified File.- Parameters:
file- a File with a JGroups XML configuration.- Returns:
- a
ProtocolStackConfiguratorcontaining the stack configuration. - Throws:
Exception- if problems occur during the configuration of the protocol stack.
-
getStackConfigurator
- Throws:
Exception
-
getStackConfigurator
Returns a protocol stack configurator based on the provided properties string.- Parameters:
properties- a string representing a system resource containing a JGroups XML configuration, a URL pointing to a JGroups XML configuration or a string representing a file name that contains a JGroups XML configuration.- Throws:
Exception
-
getConfigStream
- Throws:
Exception
-
getConfigStream
Returns a JGroups XML configuration InputStream based on the provided properties string.- Parameters:
properties- a string representing a system resource containing a JGroups XML configuration, a string representing a URL pointing to a JGroups ML configuration, or a string representing a file name that contains a JGroups XML configuration.- Throws:
IOException- if the provided properties string appears to be a valid URL but is unreachable.
-
getConfigStream
- Throws:
IOException
-
getXmlConfigurator
Returns an XmlConfigurator based on the provided properties string (if possible).- Parameters:
properties- a string representing a system resource containing a JGroups XML configuration, a string representing a URL pointing to a JGroups ML configuration, or a string representing a file name that contains a JGroups XML configuration.- Returns:
- an XmlConfigurator instance based on the provided properties string;
nullif the provided properties string does not point to an XML configuration. - Throws:
IOException- if the provided properties string appears to be a valid URL but is unreachable, or if the JGroups XML configuration pointed to by the URL can not be parsed.
-
checkJAXPAvailability
static void checkJAXPAvailability()Checks the availability of the JAXP classes on the classpath.- Throws:
NoClassDefFoundError- if the required JAXP classes are not availabile on the classpath.
-