public class Configurator extends 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(List<Protocol> protocol_list)
Creates a protocol stack by iterating through the protocol list and connecting
adjacent layers.
|
static Map<String,Map<String,Configurator.InetAddressInfo>> |
createInetAddressMap(List<ProtocolConfiguration> protocol_configs,
List<Protocol> protocols) |
protected static Protocol |
createLayer(ProtocolStack stack,
ProtocolConfiguration config) |
static Protocol |
createProtocol(String prot_spec,
ProtocolStack stack)
Creates a new protocol given the protocol specification.
|
static StackType |
determineIpVersionFromAddresses(Collection<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(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 Collection<InetAddress> |
getAddresses(Map<String,Map<String,Configurator.InetAddressInfo>> inetAddressMap)
Returns all inet addresses found
|
static Object |
getField(Field field,
Object target) |
static List<InetAddress> |
getInetAddresses(List<Protocol> protocols) |
static Object |
getValueFromProtocol(Protocol protocol,
Field field) |
static Object |
getValueFromProtocol(Protocol protocol,
String field_name) |
static boolean |
isSetPropertyMethod(Method method) |
static List<ProtocolConfiguration> |
parseConfigurations(String configuration)
Return a number of ProtocolConfigurations in a vector
|
static String |
printConfigurations(Collection<ProtocolConfiguration> configs) |
protected static String |
printEvents(List<Integer> events) |
static void |
removeDeprecatedProperties(Object obj,
Map<String,String> props) |
protected static void |
removeProvidedDownServices(Protocol protocol,
List<Integer> events)
Removes all events provided by the protocol above protocol from events
|
protected static void |
removeProvidedUpServices(Protocol protocol,
List<Integer> events)
Removes all events provided by the protocol below protocol from events
|
static void |
resolveAndAssignField(Object obj,
Field field,
Map<String,String> props) |
static void |
resolveAndAssignFields(Object obj,
Map<String,String> props) |
static void |
resolveAndInvokePropertyMethod(Object obj,
Method method,
Map<String,String> props) |
static void |
resolveAndInvokePropertyMethods(Object obj,
Map<String,String> props) |
static void |
sanityCheck(List<Protocol> protocols)
Throws an exception if sanity check fails.
|
static void |
setDefaultValues(List<Protocol> protocols) |
static void |
setDefaultValues(List<Protocol> protocols,
StackType ip_version) |
static void |
setDefaultValues(List<ProtocolConfiguration> protocol_configs,
List<Protocol> protocols,
StackType ip_version) |
static void |
setField(Field field,
Object target,
Object value) |
Protocol |
setupProtocolStack(List<ProtocolConfiguration> config) |
Protocol |
setupProtocolStack(ProtocolStack copySource) |
protected static final Log log
public Configurator()
public Configurator(ProtocolStack protocolStack)
public Protocol setupProtocolStack(List<ProtocolConfiguration> config) throws Exception
Exception
public Protocol setupProtocolStack(ProtocolStack copySource) throws Exception
Exception
public static void setDefaultValues(List<Protocol> protocols) throws Exception
Exception
public static Protocol createProtocol(String prot_spec, ProtocolStack stack) throws 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 stackException
- Will be thrown when the new protocol cannot be createdpublic static Protocol connectProtocols(List<Protocol> protocol_list) throws Exception
protocol_list
- List of Protocol elements (from top to bottom)Exception
public static List<ProtocolConfiguration> parseConfigurations(String configuration) throws Exception
configuration
- protocol-stack configuration stringException
public static String printConfigurations(Collection<ProtocolConfiguration> configs)
protected static Protocol createLayer(ProtocolStack stack, ProtocolConfiguration config) throws Exception
Exception
public static void sanityCheck(List<Protocol> protocols) throws Exception
Exception
protected static void removeProvidedUpServices(Protocol protocol, List<Integer> events)
protocol
- events
- protected static void removeProvidedDownServices(Protocol protocol, List<Integer> events)
protocol
- events
- public static Collection<InetAddress> getAddresses(Map<String,Map<String,Configurator.InetAddressInfo>> inetAddressMap) throws Exception
Exception
public static StackType determineIpVersionFromAddresses(Collection<InetAddress> addrs) throws Exception
Exception
public static Map<String,Map<String,Configurator.InetAddressInfo>> createInetAddressMap(List<ProtocolConfiguration> protocol_configs, List<Protocol> protocols) throws Exception
Exception
public static List<InetAddress> getInetAddresses(List<Protocol> protocols) throws Exception
Exception
public static void setDefaultValues(List<ProtocolConfiguration> protocol_configs, List<Protocol> protocols, StackType ip_version) throws Exception
Exception
public static void setDefaultValues(List<Protocol> protocols, StackType ip_version) throws Exception
Exception
public static void ensureValidBindAddresses(List<Protocol> protocols) throws Exception
protocols
- Exception
public static Object getValueFromProtocol(Protocol protocol, Field field) throws IllegalAccessException
IllegalAccessException
public static Object getValueFromProtocol(Protocol protocol, String field_name) throws IllegalAccessException
IllegalAccessException
public static void resolveAndInvokePropertyMethods(Object obj, Map<String,String> props) throws Exception
Exception
public static void resolveAndInvokePropertyMethod(Object obj, Method method, Map<String,String> props) throws Exception
Exception
public static void resolveAndAssignFields(Object obj, Map<String,String> props) throws Exception
Exception
public static void resolveAndAssignField(Object obj, Field field, Map<String,String> props) throws Exception
Exception
public static void removeDeprecatedProperties(Object obj, Map<String,String> props) throws Exception
Exception
public static boolean isSetPropertyMethod(Method method)
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.