Package com.tangosol.net
Class ConfigurableLocalAddressProvider
java.lang.Object
java.util.AbstractCollection
java.util.AbstractSet
com.tangosol.net.ConfigurableAddressProvider
com.tangosol.net.ConfigurableLocalAddressProvider
- All Implemented Interfaces:
AddressProvider
,DescribableAddressProvider
,SocketAddressProvider
,Iterable
,Collection
,Set
ConfigurableLocalAddressProvider is an AddressProvider which is only
capable of returning local addresses.
As is it known that only local addresses can be returned, this provider supports some formats not supported by the ConfigurableAddressProvider, namely empty and null hostnames are assumed to be equal to "localhost". Additionally, the hostname string may be in CIDR format (e.g. subnet/mask) allowing the provider to choose a matching local address.
- Since:
- Coherence 3.7.1
- Author:
- mf 2011.06.13
-
Nested Class Summary
Nested classes/interfaces inherited from class com.tangosol.net.ConfigurableAddressProvider
ConfigurableAddressProvider.AddressHolder
-
Field Summary
Fields inherited from class com.tangosol.net.ConfigurableAddressProvider
m_fResolve, m_fSafe, m_iLast, m_iterAddr, m_listHolders
-
Constructor Summary
ConstructorDescriptionConfigurableLocalAddressProvider
(int nPort) Constructs a ConfigurableLocalAddressProvider for all local IPs and the given port.ConfigurableLocalAddressProvider
(XmlElement xmlConfig) Deprecated.ConfigurableLocalAddressProvider
(XmlElement xmlConfig, boolean fSafe) Deprecated.ConfigurableLocalAddressProvider
(Iterable<ConfigurableAddressProvider.AddressHolder> addressHolders, boolean fSafe) Constructs a ConfigurableLocalAddressProvider using the specifiedConfigurableAddressProvider.AddressHolder
s. -
Method Summary
Modifier and TypeMethodDescriptionstatic AddressProviderBuilder
builder
(int nPort) Return a builder which will produce Providers for all local addresses and the specified portprotected Iterator
<InetSocketAddress> resolveAddress
(String sHost, int nPort) Resolve an address and port.Methods inherited from class com.tangosol.net.ConfigurableAddressProvider
accept, configure, equals, getAddressDescriptions, getNextAddress, hashCode, iterator, makeProvider, reject, reset, reset, size, sortHolders, toString
Methods inherited from class java.util.AbstractSet
removeAll
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Constructor Details
-
ConfigurableLocalAddressProvider
Deprecated.Construct an instance of ConfigurableLocalAddressProvider based on the specified XML element.Unresolvable addresses will be skipped.
- Parameters:
xmlConfig
- the XML element that contains the configuration info
-
ConfigurableLocalAddressProvider
public ConfigurableLocalAddressProvider(Iterable<ConfigurableAddressProvider.AddressHolder> addressHolders, boolean fSafe) Constructs a ConfigurableLocalAddressProvider using the specifiedConfigurableAddressProvider.AddressHolder
s.- Parameters:
addressHolders
- theConfigurableAddressProvider.AddressHolder
sfSafe
- true if the provider skips unresolved addresses
-
ConfigurableLocalAddressProvider
public ConfigurableLocalAddressProvider(int nPort) Constructs a ConfigurableLocalAddressProvider for all local IPs and the given port. -
ConfigurableLocalAddressProvider
Deprecated.Construct an instance of ConfigurableLocalAddressProvider based on the specified XML element.- Parameters:
xmlConfig
- the XML element that contains the configuration infofSafe
- true if the provider is skips unresolved addresses
-
-
Method Details
-
resolveAddress
Resolve an address and port.- Overrides:
resolveAddress
in classConfigurableAddressProvider
- Parameters:
sHost
- the hostnPort
- the port- Returns:
- the InetSocketAddress
-
builder
Return a builder which will produce Providers for all local addresses and the specified port- Parameters:
nPort
- the port- Returns:
- the builder
-