Class ProtocolConfiguration

java.lang.Object
org.jgroups.conf.ProtocolConfiguration

public class ProtocolConfiguration extends Object
Parses and encapsulates the specification for 1 protocol of the protocol stack, e.g. UNICAST(timeout=5000)
  • Field Details

  • Constructor Details

    • ProtocolConfiguration

      public ProtocolConfiguration(String config_str) throws Exception
      Creates a new ProtocolConfiguration.
      Parameters:
      config_str - The configuration specification for the protocol, e.g.
      VERIFY_SUSPECT(timeout=1500)
      Throws:
      Exception
    • ProtocolConfiguration

      public ProtocolConfiguration(String protocol_name, Map<String,String> properties)
    • ProtocolConfiguration

      public ProtocolConfiguration(String protocol_name, Map<String,String> properties, ClassLoader loader)
  • Method Details

    • addSubtree

      public void addSubtree(XmlNode node)
    • getSubtrees

      public List<XmlNode> getSubtrees()
    • getProtocolName

      public String getProtocolName()
    • getClassLoader

      public ClassLoader getClassLoader()
    • getProperties

      public Map<String,String> getProperties()
    • loadProtocolClass

      public Class<? extends Protocol> loadProtocolClass(Class<?> loadingClass) throws Exception
      Load the class of the Protocol configured by this instance.
      Parameters:
      loadingClass - The Class to fetch the preferred ClassLoader. It can be null.
      Returns:
      The Class of the Protocol.
      Throws:
      Exception - If unable to find or load the class.
    • isAssignableProtocol

      public boolean isAssignableProtocol(Class<? extends Protocol> other, Class<?> loadingClass) throws Exception
      Determines if the class other is the same or superclass (or superinterface) as the Protocol configured by this instance.
      Parameters:
      other - The Class to check.
      loadingClass - The Class to fetch the preferred ClassLoader. It can be null.
      Returns:
      true if other is the same or superclass/interface as the Protocol configured by this instance.
      Throws:
      Exception - If unable to find or load the class.
    • substituteVariables

      public void substituteVariables()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • propertiesToString

      public String propertiesToString()
    • getProtocolString

      public String getProtocolString(boolean new_format)
    • getProtocolString

      public String getProtocolString()
    • getProtocolStringNewXml

      public String getProtocolStringNewXml()
    • getParameterString

      protected static String getParameterString(String name, String value)
    • getParameterStringXml

      protected static String getParameterStringXml(String name, String val)
    • parsePropertiesString

      protected void parsePropertiesString(Map<String,String> properties) throws Exception
      Throws:
      Exception