Class ListBasedAddressProviderBuilder
- java.lang.Object
-
- com.tangosol.coherence.config.builder.ListBasedAddressProviderBuilder
-
- All Implemented Interfaces:
AddressProviderBuilder
,ParameterizedBuilder<AddressProvider>
,AddressProviderFactory
public class ListBasedAddressProviderBuilder extends Object implements AddressProviderBuilder
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
Constructors Constructor Description ListBasedAddressProviderBuilder()
ConstructsListBasedAddressProviderBuilder
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ListBasedAddressProviderBuilder
add(String sAddr, int nPort)
Add an address and port.AddressProvider
createAddressProvider(ClassLoader loader)
Create a new AddressProvider using the specified class loader.boolean
isEmpty()
Returnstrue
if this builder contains no addresses.boolean
isRefreshable()
Returns true if any of the added addresses has been computed to be a hostname.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.
-
-
-
Constructor Detail
-
ListBasedAddressProviderBuilder
public ListBasedAddressProviderBuilder()
ConstructsListBasedAddressProviderBuilder
-
-
Method Detail
-
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
public AddressProvider createAddressProvider(ClassLoader loader)
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
public ListBasedAddressProviderBuilder add(String sAddr, int nPort)
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
-
-