Class MutableRegistryProvider

java.lang.Object
org.wildfly.discovery.impl.MutableRegistryProvider
All Implemented Interfaces:
RegistryProvider

public final class MutableRegistryProvider extends Object implements RegistryProvider
A service registry provider which can be mutated at run time to delegate to a new provider.
Author:
David M. Lloyd
  • Constructor Details

    • MutableRegistryProvider

      public MutableRegistryProvider(RegistryProvider initialProvider)
      Construct a new instance.
      Parameters:
      initialProvider - the initial provider to use (must not be null)
    • MutableRegistryProvider

      public MutableRegistryProvider()
      Construct a new instance using an empty provider.
  • Method Details

    • registerService

      public ServiceRegistration registerService(ServiceURL serviceURL)
      Description copied from interface: RegistryProvider
      Register a service with this provider. Service URLs which are unsupported must be ignored; in this case, the empty registration handle must be returned.
      Specified by:
      registerService in interface RegistryProvider
      Parameters:
      serviceURL - the service to register (not null)
      Returns:
      the service registration handle (must not be null)
    • registerServices

      public ServiceRegistration registerServices(ServiceURL... serviceURLs)
      Description copied from interface: RegistryProvider
      Register multiple services with this provider at once. Service URLs which are unsupported must be ignored. If none of the service URLs are supported, then the empty registration handle must be returned.

      The default implementation calls RegistryProvider.registerService(ServiceURL) for each service in the array and returns an aggregated handle.

      Specified by:
      registerServices in interface RegistryProvider
      Parameters:
      serviceURLs - the services to register (not null, will not contain null elements)
      Returns:
      the service registration handle (must not be null)
    • setRegistryProvider

      public void setRegistryProvider(RegistryProvider delegateProvider)
      Set the registry provider instance.
      Parameters:
      delegateProvider - the registry provider instance (must not be null)