Package org.jgroups.conf
Class ProtocolConfiguration
- java.lang.Object
-
- org.jgroups.conf.ProtocolConfiguration
-
public class ProtocolConfiguration extends java.lang.ObjectParses and encapsulates the specification for 1 protocol of the protocol stack, e.g.UNICAST(timeout=5000)- Author:
- Bela Ban
-
-
Constructor Summary
Constructors Constructor Description ProtocolConfiguration(java.lang.String config_str)Creates a new ProtocolConfiguration.ProtocolConfiguration(java.lang.String protocol_name, java.util.Map<java.lang.String,java.lang.String> properties)ProtocolConfiguration(java.lang.String protocol_name, java.util.Map<java.lang.String,java.lang.String> properties, java.lang.ClassLoader loader)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSubtree(XmlNode node)java.lang.ClassLoadergetClassLoader()protected static java.lang.StringgetParameterString(java.lang.String name, java.lang.String value)protected static java.lang.StringgetParameterStringXml(java.lang.String name, java.lang.String val)java.util.Map<java.lang.String,java.lang.String>getProperties()java.lang.StringgetProtocolName()java.lang.StringgetProtocolString()java.lang.StringgetProtocolString(boolean new_format)java.lang.StringgetProtocolStringNewXml()java.util.List<XmlNode>getSubtrees()booleanisAssignableProtocol(java.lang.Class<? extends Protocol> other, java.lang.Class<?> loadingClass)Determines if the classotheris the same or superclass (or superinterface) as theProtocolconfigured by this instance.java.lang.Class<? extends Protocol>loadProtocolClass(java.lang.Class<?> loadingClass)Load the class of theProtocolconfigured by this instance.protected voidparsePropertiesString(java.util.Map<java.lang.String,java.lang.String> properties)java.lang.StringpropertiesToString()voidsubstituteVariables()java.lang.StringtoString()
-
-
-
Constructor Detail
-
ProtocolConfiguration
public ProtocolConfiguration(java.lang.String config_str) throws java.lang.ExceptionCreates a new ProtocolConfiguration.- Parameters:
config_str- The configuration specification for the protocol, e.g.VERIFY_SUSPECT(timeout=1500)
- Throws:
java.lang.Exception
-
ProtocolConfiguration
public ProtocolConfiguration(java.lang.String protocol_name, java.util.Map<java.lang.String,java.lang.String> properties)
-
ProtocolConfiguration
public ProtocolConfiguration(java.lang.String protocol_name, java.util.Map<java.lang.String,java.lang.String> properties, java.lang.ClassLoader loader)
-
-
Method Detail
-
addSubtree
public void addSubtree(XmlNode node)
-
getSubtrees
public java.util.List<XmlNode> getSubtrees()
-
getProtocolName
public java.lang.String getProtocolName()
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
-
getProperties
public java.util.Map<java.lang.String,java.lang.String> getProperties()
-
loadProtocolClass
public java.lang.Class<? extends Protocol> loadProtocolClass(java.lang.Class<?> loadingClass) throws java.lang.Exception
Load the class of theProtocolconfigured by this instance.- Parameters:
loadingClass- TheClassto fetch the preferredClassLoader. It can be null.- Returns:
- The
Classof theProtocol. - Throws:
java.lang.Exception- If unable to find or load the class.
-
isAssignableProtocol
public boolean isAssignableProtocol(java.lang.Class<? extends Protocol> other, java.lang.Class<?> loadingClass) throws java.lang.Exception
Determines if the classotheris the same or superclass (or superinterface) as theProtocolconfigured by this instance.- Parameters:
other- TheClassto check.loadingClass- TheClassto fetch the preferredClassLoader. It can be null.- Returns:
trueifotheris the same or superclass/interface as theProtocolconfigured by this instance.- Throws:
java.lang.Exception- If unable to find or load the class.
-
substituteVariables
public void substituteVariables()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
propertiesToString
public java.lang.String propertiesToString()
-
getProtocolString
public java.lang.String getProtocolString(boolean new_format)
-
getProtocolString
public java.lang.String getProtocolString()
-
getProtocolStringNewXml
public java.lang.String getProtocolStringNewXml()
-
getParameterString
protected static java.lang.String getParameterString(java.lang.String name, java.lang.String value)
-
getParameterStringXml
protected static java.lang.String getParameterStringXml(java.lang.String name, java.lang.String val)
-
parsePropertiesString
protected void parsePropertiesString(java.util.Map<java.lang.String,java.lang.String> properties) throws java.lang.Exception- Throws:
java.lang.Exception
-
-