Class ConfiguratorFactory

java.lang.Object
org.jgroups.conf.ConfiguratorFactory

public class ConfiguratorFactory extends 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
2. PlainConfigurator - uses the old style strings UDP:FRAG: etc etc
Author:
Filip Hanik (filip@filip.net), Bela Ban
  • Constructor Details

    • ConfiguratorFactory

      protected ConfiguratorFactory()
  • Method Details

    • getStackConfigurator

      public static ProtocolStackConfigurator getStackConfigurator(File file) throws Exception
      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 ProtocolStackConfigurator containing the stack configuration.
      Throws:
      Exception - if problems occur during the configuration of the protocol stack.
    • getStackConfigurator

      public static ProtocolStackConfigurator getStackConfigurator(InputStream input) throws Exception
      Throws:
      Exception
    • getStackConfigurator

      public static ProtocolStackConfigurator getStackConfigurator(String properties) throws Exception
      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

      public static InputStream getConfigStream(File file) throws Exception
      Throws:
      Exception
    • getConfigStream

      public static InputStream getConfigStream(String properties) throws IOException
      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

      public static InputStream getConfigStream(Object properties) throws IOException
      Throws:
      IOException