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
  • Constructor Details

  • 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 provided ParameterResolver to resolve values any referenced Parameters.
      Specified by:
      realize in interface ParameterizedBuilder<AddressProvider>
      Parameters:
      resolver - the ParameterResolver for resolving named Parameters
      loader - the ClassLoader for loading any necessary classes and if null the ClassLoader used to load the builder will be used instead
      listParameters - an optional ParameterList (may be null) 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 interface AddressProviderFactory
      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 name
      nPort - 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()
      Returns true if this builder contains no addresses.
      Returns:
      true if this builder contains no addresses