|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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.InetAddressInfo
|
Field Summary | |
---|---|
protected static Log |
log
|
Constructor Summary | |
---|---|
Configurator()
|
|
Configurator(ProtocolStack protocolStack)
|
Method Summary | |
---|---|
static Protocol |
connectProtocols(java.util.List<Protocol> protocol_list)
Creates a protocol stack by iterating through the protocol list and connecting adjacent layers. |
static java.util.Map<java.lang.String,java.util.Map<java.lang.String,Configurator.InetAddressInfo>> |
createInetAddressMap(java.util.List<ProtocolConfiguration> protocol_configs,
java.util.List<Protocol> protocols)
|
protected static Protocol |
createLayer(ProtocolStack stack,
ProtocolConfiguration config)
|
static Protocol |
createProtocol(java.lang.String prot_spec,
ProtocolStack stack)
Creates a new protocol given the protocol specification. |
static StackType |
determineIpVersionFromAddresses(java.util.Collection<java.net.InetAddress> addrs)
This method takes a set of InetAddresses, represented by an inetAddressmap, and: - if the resulting set is non-empty, goes through to see if all InetAddress-related user settings have a consistent IP version: v4 or v6, and throws an exception if not - if the resulting set is empty, sets the default IP version based on available stacks and if a dual stack, stack preferences - sets the IP version to be used in the JGroups session |
static void |
ensureValidBindAddresses(java.util.List<Protocol> protocols)
Makes sure that all fields annotated with @LocalAddress is (1) an InetAddress and (2) a valid address on any local network interface |
static java.util.Collection<java.net.InetAddress> |
getAddresses(java.util.Map<java.lang.String,java.util.Map<java.lang.String,Configurator.InetAddressInfo>> inetAddressMap)
Returns all inet addresses found |
static java.util.List<java.net.InetAddress> |
getInetAddresses(java.util.List<Protocol> protocols)
|
static java.lang.Object |
getValueFromProtocol(Protocol protocol,
java.lang.reflect.Field field)
|
static java.lang.Object |
getValueFromProtocol(Protocol protocol,
java.lang.String field_name)
|
static boolean |
isSetPropertyMethod(java.lang.reflect.Method method)
|
static java.util.List<ProtocolConfiguration> |
parseConfigurations(java.lang.String configuration)
Return a number of ProtocolConfigurations in a vector |
static java.lang.String |
printConfigurations(java.util.Collection<ProtocolConfiguration> configs)
|
protected static java.lang.String |
printEvents(java.util.List<java.lang.Integer> events)
|
static void |
removeDeprecatedProperties(java.lang.Object obj,
java.util.Map<java.lang.String,java.lang.String> props)
|
protected static void |
removeProvidedDownServices(Protocol protocol,
java.util.List<java.lang.Integer> events)
Removes all events provided by the protocol above protocol from events |
protected static void |
removeProvidedUpServices(Protocol protocol,
java.util.List<java.lang.Integer> events)
Removes all events provided by the protocol below protocol from events |
static void |
resolveAndAssignField(java.lang.Object obj,
java.lang.reflect.Field field,
java.util.Map<java.lang.String,java.lang.String> props)
|
static void |
resolveAndAssignFields(java.lang.Object obj,
java.util.Map<java.lang.String,java.lang.String> props)
|
static void |
resolveAndInvokePropertyMethod(java.lang.Object obj,
java.lang.reflect.Method method,
java.util.Map<java.lang.String,java.lang.String> props)
|
static void |
resolveAndInvokePropertyMethods(java.lang.Object obj,
java.util.Map<java.lang.String,java.lang.String> props)
|
static void |
sanityCheck(java.util.List<Protocol> protocols)
Throws an exception if sanity check fails. |
static void |
setDefaultValues(java.util.List<Protocol> protocols)
|
static void |
setDefaultValues(java.util.List<Protocol> protocols,
StackType ip_version)
|
static void |
setDefaultValues(java.util.List<ProtocolConfiguration> protocol_configs,
java.util.List<Protocol> protocols,
StackType ip_version)
|
Protocol |
setupProtocolStack(java.util.List<ProtocolConfiguration> config)
|
Protocol |
setupProtocolStack(ProtocolStack copySource)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final Log log
Constructor Detail |
---|
public Configurator()
public Configurator(ProtocolStack protocolStack)
Method Detail |
---|
public Protocol setupProtocolStack(java.util.List<ProtocolConfiguration> config) throws java.lang.Exception
java.lang.Exception
public Protocol setupProtocolStack(ProtocolStack copySource) throws java.lang.Exception
java.lang.Exception
public static void setDefaultValues(java.util.List<Protocol> protocols) throws java.lang.Exception
java.lang.Exception
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 Protocol connectProtocols(java.util.List<Protocol> protocol_list) throws java.lang.Exception
protocol_list
- List of Protocol elements (from top to bottom)
java.lang.Exception
public static java.util.List<ProtocolConfiguration> parseConfigurations(java.lang.String configuration) throws java.lang.Exception
configuration
- protocol-stack configuration string
java.lang.Exception
public static java.lang.String printConfigurations(java.util.Collection<ProtocolConfiguration> configs)
protected static Protocol createLayer(ProtocolStack stack, ProtocolConfiguration config) throws java.lang.Exception
java.lang.Exception
public static void sanityCheck(java.util.List<Protocol> protocols) throws java.lang.Exception
java.lang.Exception
protected static java.lang.String printEvents(java.util.List<java.lang.Integer> events)
protected static void removeProvidedUpServices(Protocol protocol, java.util.List<java.lang.Integer> events)
protocol
- events
- protected static void removeProvidedDownServices(Protocol protocol, java.util.List<java.lang.Integer> events)
protocol
- events
- public static java.util.Collection<java.net.InetAddress> getAddresses(java.util.Map<java.lang.String,java.util.Map<java.lang.String,Configurator.InetAddressInfo>> inetAddressMap) throws java.lang.Exception
java.lang.Exception
public static StackType determineIpVersionFromAddresses(java.util.Collection<java.net.InetAddress> addrs) throws java.lang.Exception
java.lang.Exception
public static java.util.Map<java.lang.String,java.util.Map<java.lang.String,Configurator.InetAddressInfo>> createInetAddressMap(java.util.List<ProtocolConfiguration> protocol_configs, java.util.List<Protocol> protocols) throws java.lang.Exception
java.lang.Exception
public static java.util.List<java.net.InetAddress> getInetAddresses(java.util.List<Protocol> protocols) throws java.lang.Exception
java.lang.Exception
public static void setDefaultValues(java.util.List<ProtocolConfiguration> protocol_configs, java.util.List<Protocol> protocols, StackType ip_version) throws java.lang.Exception
java.lang.Exception
public static void setDefaultValues(java.util.List<Protocol> protocols, StackType ip_version) throws java.lang.Exception
java.lang.Exception
public static void ensureValidBindAddresses(java.util.List<Protocol> protocols) throws java.lang.Exception
protocols
-
java.lang.Exception
public static java.lang.Object getValueFromProtocol(Protocol protocol, java.lang.reflect.Field field) throws java.lang.IllegalAccessException
java.lang.IllegalAccessException
public static java.lang.Object getValueFromProtocol(Protocol protocol, java.lang.String field_name) throws java.lang.IllegalAccessException
java.lang.IllegalAccessException
public static void resolveAndInvokePropertyMethods(java.lang.Object obj, java.util.Map<java.lang.String,java.lang.String> props) throws java.lang.Exception
java.lang.Exception
public static void resolveAndInvokePropertyMethod(java.lang.Object obj, java.lang.reflect.Method method, java.util.Map<java.lang.String,java.lang.String> props) throws java.lang.Exception
java.lang.Exception
public static void resolveAndAssignFields(java.lang.Object obj, java.util.Map<java.lang.String,java.lang.String> props) throws java.lang.Exception
java.lang.Exception
public static void resolveAndAssignField(java.lang.Object obj, java.lang.reflect.Field field, java.util.Map<java.lang.String,java.lang.String> props) throws java.lang.Exception
java.lang.Exception
public static void removeDeprecatedProperties(java.lang.Object obj, java.util.Map<java.lang.String,java.lang.String> props) throws java.lang.Exception
java.lang.Exception
public static boolean isSetPropertyMethod(java.lang.reflect.Method method)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |