Class LocalAddressProviderBuilder
java.lang.Object
com.tangosol.coherence.config.builder.LocalAddressProviderBuilder
- All Implemented Interfaces:
AddressProviderBuilder
,ParameterizedBuilder<AddressProvider>
,AddressProviderFactory
This class builds an AddressProviderBuilder from a local address.
All ConfigurationExceptions are deferred until realization time.
- Since:
- Coherence 12.2.1
- Author:
- jf 2015.02.26
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.tangosol.coherence.config.builder.ParameterizedBuilder
ParameterizedBuilder.ReflectionSupport
-
Field Summary
-
Constructor Summary
ConstructorDescriptionLocalAddressProviderBuilder
(String sAddr, int nPortMin, int nPortMax) ConstructsLocalAddressProviderBuilder
deferring address resolution until realized.LocalAddressProviderBuilder
(String sAddr, int nPortMin, int nPortMax, XmlElement xmlConfig) ConstructsLocalAddressProviderBuilder
deferring address resolution until realized.LocalAddressProviderBuilder
(InetAddress addr, int nPortMin, int nPortMax) ConstructsLocalAddressProviderBuilder
with a resolved address. -
Method Summary
Modifier and TypeMethodDescriptioncreateAddressProvider
(ClassLoader loader) Create a new AddressProvider using the specified class loader.int
Return the minimum port number.int
Return the minimum port number provided in the constructor.realize
(ParameterResolver resolver, ClassLoader loader, ParameterList listParameters) Realizes (creates if necessary) an instance of a object of type T, using the providedParameterResolver
to resolve values any referencedParameter
s.Resolve the host address if provided as a string and cache the value.setAddress
(InetAddress addr) Set the address to use for any realizedAddressProvider
'ssetPortMax
(int nPort) Set the maximum port number.setPortMin
(int nPort) Set the minimum port number.
-
Field Details
-
MIN_PORT
public static final int MIN_PORT- See Also:
-
MAX_PORT
public static final int MAX_PORT- See Also:
-
-
Constructor Details
-
LocalAddressProviderBuilder
ConstructsLocalAddressProviderBuilder
with a resolved address.- Parameters:
addr
- the local address, or nullnPortMin
- the minimum port to use, or -1 to use ephemeral sub-portsnPortMax
- the maximum port to use
-
LocalAddressProviderBuilder
ConstructsLocalAddressProviderBuilder
deferring address resolution until realized.- Parameters:
sAddr
- the local address, or nullnPortMin
- the minimum port to use, or -1 to use ephemeral sub-portsnPortMax
- the maximum port to usexmlConfig
- optional xml to used in ConfigurationException if this is invalid.
-
LocalAddressProviderBuilder
ConstructsLocalAddressProviderBuilder
deferring address resolution until realized.- Parameters:
sAddr
- the local address, or nullnPortMin
- the minimum port to use, or -1 to use ephemeral sub-portsnPortMax
- the maximum port to use
-
-
Method Details
-
realize
public AddressProvider realize(ParameterResolver resolver, ClassLoader loader, ParameterList listParameters) Realizes (creates if necessary) an instance of a object of type T, using the providedParameterResolver
to resolve values any referencedParameter
s.- Specified by:
realize
in interfaceParameterizedBuilder<AddressProvider>
- Parameters:
resolver
- theParameterResolver
for resolving namedParameter
sloader
- theClassLoader
for loading any necessary classes and ifnull
theClassLoader
used to load the builder will be used insteadlistParameters
- an optionalParameterList
(may benull
) to be used for realizing the instance, eg: used as constructor parameters- Returns:
- an instance of T
-
createAddressProvider
Create a new AddressProvider using the specified class loader.- Specified by:
createAddressProvider
in interfaceAddressProviderFactory
- Parameters:
loader
- the optional ClassLoader with which to configure the new AddressProvider- Returns:
- a new AddressProvider
-
resolveAddress
Resolve the host address if provided as a string and cache the value.May return null.
- Returns:
- the resolved host address
-
setAddress
Set the address to use for any realizedAddressProvider
's- Parameters:
addr
- theInetAddress
- Returns:
- this
LocalAddressProviderBuilder
-
getPortMin
public int getPortMin()Return the minimum port number.- Returns:
- the minimum port number
-
setPortMin
Set the minimum port number.- Parameters:
nPort
- the minimum port number- Returns:
- this
LocalAddressProviderBuilder
-
getPortMinOriginal
public int getPortMinOriginal()Return the minimum port number provided in the constructor.- Returns:
- the minimum port number
-
setPortMax
Set the maximum port number.- Parameters:
nPort
- the maximum port number- Returns:
- this
LocalAddressProviderBuilder
-