|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgroups.stack.Configurator
public class Configurator
The task if this class is to setup and configure the protocol stack. A string describing the desired setup, which is both the layering and the configuration of each layer, is given to the configurator which creates and configures the protocol stack and returns a reference to the top layer (Protocol).
Future functionality will include the capability to dynamically modify the layering of the protocol stack and the properties of each layer.
Nested Class Summary | |
---|---|
static class |
Configurator.ProtocolConfiguration
Parses and encapsulates the specification for 1 protocol of the protocol stack, e.g. |
Field Summary | |
---|---|
protected static org.apache.commons.logging.Log |
log
|
Constructor Summary | |
---|---|
Configurator()
|
Method Summary | |
---|---|
static Protocol |
createProtocol(java.lang.String prot_spec,
ProtocolStack stack)
Creates a new protocol given the protocol specification. |
static void |
destroyProtocolStack(java.util.List<Protocol> protocols)
|
static Protocol |
findProtocol(Protocol prot_stack,
java.lang.String name)
|
static Protocol |
getBottommostProtocol(Protocol prot_stack)
|
static void |
initProtocolStack(java.util.List<Protocol> protocols)
|
static void |
insertProtocol(Protocol prot,
int position,
java.lang.Class<? extends Protocol> neighbor_prot,
ProtocolStack stack)
|
static void |
insertProtocol(Protocol prot,
int position,
java.lang.String neighbor_prot,
ProtocolStack stack)
Inserts an already created (and initialized) protocol into the protocol list. |
protected static void |
insertProtocol(Protocol prot,
Protocol neighbor,
int position)
|
static java.util.Vector<Configurator.ProtocolConfiguration> |
parseConfigurations(java.lang.String configuration)
Return a number of ProtocolConfigurations in a vector |
static java.util.Vector<java.lang.String> |
parseProtocols(java.lang.String config_str)
Get a string of the form "P1(config_str1):P2:P3(config_str3)" and return ProtocolConfigurations for it. |
static Protocol |
removeProtocol(Protocol top_prot,
java.lang.String prot_name)
Removes a protocol from the stack. |
static void |
sanityCheck(java.util.Vector<Protocol> protocols)
Throws an exception if sanity check fails. |
static Protocol |
setupProtocolStack(java.lang.String configuration,
ProtocolStack st)
The configuration string has a number of entries, separated by a ':' (colon). |
static void |
startProtocolStack(java.util.List<Protocol> protocols,
java.lang.String cluster_name,
java.util.Map<java.lang.String,Tuple<TP,java.lang.Short>> singletons)
|
static void |
stopProtocolStack(java.util.List<Protocol> protocols,
java.lang.String cluster_name,
java.util.Map<java.lang.String,Tuple<TP,java.lang.Short>> singletons)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.commons.logging.Log log
Constructor Detail |
---|
public Configurator()
Method Detail |
---|
public static Protocol setupProtocolStack(java.lang.String configuration, ProtocolStack st) throws java.lang.Exception
UDP(in_port=5555;out_port=4445):FRAG(frag_size=1024)
The first entry defines the bottommost layer, the string is parsed left to right and the protocol stack constructed bottom up. Example: the string "UDP(in_port=5555):FRAG(frag_size=32000):DEBUG" results is the following stack:
----------------------- | DEBUG | |-----------------------| | FRAG frag_size=32000 | |-----------------------| | UDP in_port=32000 | -----------------------
java.lang.Exception
public static void initProtocolStack(java.util.List<Protocol> protocols) throws java.lang.Exception
java.lang.Exception
public static void startProtocolStack(java.util.List<Protocol> protocols, java.lang.String cluster_name, java.util.Map<java.lang.String,Tuple<TP,java.lang.Short>> singletons) throws java.lang.Exception
java.lang.Exception
public static void stopProtocolStack(java.util.List<Protocol> protocols, java.lang.String cluster_name, java.util.Map<java.lang.String,Tuple<TP,java.lang.Short>> singletons)
public static void destroyProtocolStack(java.util.List<Protocol> protocols)
public static Protocol findProtocol(Protocol prot_stack, java.lang.String name)
public static Protocol getBottommostProtocol(Protocol prot_stack)
public static Protocol createProtocol(java.lang.String prot_spec, ProtocolStack stack) throws java.lang.Exception
prot_spec
- The specification of the protocol. Same convention as for specifying a protocol stack.
An exception will be thrown if the class cannot be created. Example:
"VERIFY_SUSPECT(timeout=1500)"Note that no colons (:) have to be specified
stack
- The protocol stack
java.lang.Exception
- Will be thrown when the new protocol cannot be createdpublic static void insertProtocol(Protocol prot, int position, java.lang.String neighbor_prot, ProtocolStack stack) throws java.lang.Exception
prot
- The protocol to be inserted. Before insertion, a sanity check will ensure that none
of the existing protocols have the same name as the new protocol.position
- Where to place the protocol with respect to the neighbor_prot (ABOVE, BELOW)neighbor_prot
- The name of the neighbor protocol. An exception will be thrown if this name
is not foundstack
- The protocol stack
java.lang.Exception
- Will be thrown when the new protocol cannot be created, or inserted.public static void insertProtocol(Protocol prot, int position, java.lang.Class<? extends Protocol> neighbor_prot, ProtocolStack stack) throws java.lang.Exception
java.lang.Exception
protected static void insertProtocol(Protocol prot, Protocol neighbor, int position)
public static Protocol removeProtocol(Protocol top_prot, java.lang.String prot_name) throws java.lang.Exception
prot_name
- The name of the protocol. Since all protocol names in a stack have to be unique
(otherwise the stack won't be created), the name refers to just 1 protocol.
java.lang.Exception
- Thrown if the protocol cannot be stopped correctly.public static java.util.Vector<java.lang.String> parseProtocols(java.lang.String config_str) throws java.io.IOException
config_str
- Configuration string
java.io.IOException
public static java.util.Vector<Configurator.ProtocolConfiguration> parseConfigurations(java.lang.String configuration) throws java.lang.Exception
configuration
- protocol-stack configuration string
java.lang.Exception
public static void sanityCheck(java.util.Vector<Protocol> protocols) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |