org.jgroups.conf
Class ConfiguratorFactory
java.lang.Object
org.jgroups.conf.ConfiguratorFactory
public class ConfiguratorFactory
extends java.lang.Object
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 that are according to the jgroups-protocol.dtd
2. PlainConfigurator - uses the old style strings UDP:FRAG: etc etc
JAXP_MISSING_ERROR_MSG
public static final String JAXP_MISSING_ERROR_MSG
ConfiguratorFactory
protected ConfiguratorFactory()
getStackConfigurator
public static ProtocolStackConfigurator getStackConfigurator(Element element)
throws ChannelException
Returns a protocol stack configurator based on the XML configuration
provided by the specified XML element.
element
- a XML element containing a JGroups XML configuration.
- a
ProtocolStackConfigurator
containing the stack
configuration.
ChannelException
- if problems occur during the configuration of
the protocol stack.
getStackConfigurator
public static ProtocolStackConfigurator getStackConfigurator(File file)
throws ChannelException
Returns a protocol stack configurator based on the XML configuration
provided by the specified File.
file
- a File with a JGroups XML configuration.
- a
ProtocolStackConfigurator
containing the stack
configuration.
ChannelException
- if problems occur during the configuration of
the protocol stack.
getStackConfigurator
public static ProtocolStackConfigurator getStackConfigurator(Object properties)
throws IOException
Used by the JChannel(Object) constructor which has been deprecated.
Returns a protocol stack configurator based on the properties passed in.
If the properties parameter is a plain string UDP:FRAG:MERGE:GMS etc, a PlainConfigurator is returned.
If the properties parameter is a string that represents a url for example http://www.filip.net/test.xml
or the parameter is a java.net.URL object, an XmlConfigurator is returned
properties
- old style property string, url string, or java.net.URL object
- a ProtocolStackConfigurator containing the stack configuration
getStackConfigurator
public static ProtocolStackConfigurator getStackConfigurator(String properties)
throws ChannelException
Returns a protocol stack configurator based on the provided properties
string.
properties
- an old style property string, a string representing a
system resource containing a JGroups XML configuration,
a string representing a URL pointing to a JGroups XML
XML configuration, or a string representing a file name
that contains a JGroups XML configuration.
getStackConfigurator
public static ProtocolStackConfigurator getStackConfigurator(URL url)
throws ChannelException
Returns a protocol stack configurator based on the XML configuration
provided at the specified URL.
url
- a URL pointing to a JGroups XML configuration.
- a
ProtocolStackConfigurator
containing the stack
configuration.
ChannelException
- if problems occur during the configuration of
the protocol stack.
Copyright B) 1998-2005 Bela Ban. All Rights Reserved.