Class ListBasedAddressProviderBuilder
java.lang.Object
com.tangosol.coherence.config.builder.ListBasedAddressProviderBuilder
- All Implemented Interfaces:
AddressProviderBuilder
,ParameterizedBuilder<AddressProvider>
,AddressProviderFactory
This class builds an AddressProviderBuilder from a list of address and port.
- 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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdd an address and port.createAddressProvider
(ClassLoader loader) Create a new AddressProvider using the specified class loader.boolean
isEmpty()
Returnstrue
if this builder contains no addresses.boolean
Returns true if any of the added addresses has been computed to be a hostname.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.
-
Constructor Details
-
ListBasedAddressProviderBuilder
public ListBasedAddressProviderBuilder()ConstructsListBasedAddressProviderBuilder
-
-
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
-
add
Add an address and port.- Parameters:
sAddr
- either an ip address or a host namenPort
- a non-negative port
-
isRefreshable
public boolean isRefreshable()Returns true if any of the added addresses has been computed to be a hostname.Introduced for unit testing.
- Returns:
- true iff the realized AddressProvider will refresh its list.
-
isEmpty
public boolean isEmpty()Returnstrue
if this builder contains no addresses.- Returns:
true
if this builder contains no addresses
-