public class Configurator
extends java.lang.Object
Future functionality will include the capability to dynamically modify the layering of the protocol stack and the properties of each layer.
Modifier and Type | Class and Description |
---|---|
static class |
Configurator.InetAddressInfo |
Constructor and Description |
---|
Configurator() |
Configurator(ProtocolStack protocolStack) |
Modifier and Type | Method and Description |
---|---|
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 java.util.List<Protocol> |
createProtocols(java.util.List<ProtocolConfiguration> protocol_configs,
ProtocolStack stack)
Takes vector of ProtocolConfigurations, iterates through it, creates Protocol for
each ProtocolConfiguration and returns all Protocols in a list.
|
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) |
static Protocol |
setupProtocolStack(java.util.List<ProtocolConfiguration> protocol_configs,
ProtocolStack st)
The configuration string has a number of entries, separated by a ':' (colon).
|
Protocol |
setupProtocolStack(ProtocolStack copySource) |
protected static final Log log
public Configurator()
public Configurator(ProtocolStack protocolStack)
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 Protocol setupProtocolStack(java.util.List<ProtocolConfiguration> protocol_configs, 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 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 stackjava.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 stringjava.lang.Exception
public static java.lang.String printConfigurations(java.util.Collection<ProtocolConfiguration> configs)
public static java.util.List<Protocol> createProtocols(java.util.List<ProtocolConfiguration> protocol_configs, ProtocolStack stack) throws java.lang.Exception
protocol_configs
- List of ProtocolConfigurationsstack
- The protocol stackjava.lang.Exception
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)
Copyright © 1998-2020 Red Hat. All Rights Reserved.