Class ServiceRegistry

java.lang.Object
org.wildfly.discovery.ServiceRegistry
All Implemented Interfaces:
org.wildfly.common.context.Contextual<ServiceRegistry>

public final class ServiceRegistry extends Object implements org.wildfly.common.context.Contextual<ServiceRegistry>
A configured service registry. A service registry is able to advertise services to local or remote clients.

Some providers only support certain types of services and will ignore others. Some providers cannot support repeated attribute values, or may be restricted as to which attribute names are recognized, or may not support attributes at all. Such providers generally must evaluate a service URL and determine if it can correctly advertise it, ignoring the registration if the provider cannot.

Author:
David M. Lloyd
  • Method Details

    • getInstanceContextManager

      public org.wildfly.common.context.ContextManager<ServiceRegistry> getInstanceContextManager()
      Get the instance context manager. Delegates to getContextManager().
      Specified by:
      getInstanceContextManager in interface org.wildfly.common.context.Contextual<ServiceRegistry>
      Returns:
      the instance context manager (not null)
    • getContextManager

      public static org.wildfly.common.context.ContextManager<ServiceRegistry> getContextManager()
      Get the context manager.
      Returns:
      the context manager (not null)
    • create

      public static ServiceRegistry create(RegistryProvider registryProvider)
      Create a new service registry instance.
      Parameters:
      registryProvider - the backing registry provider (must not be null)
      Returns:
      the new service registry (not null)
    • registerService

      public ServiceRegistration registerService(ServiceURL serviceURL)
      Register a service URL. Any valid service URL may be provided, and the registration will last until the handle is closed. If the service URL is not supported, the empty registration handle is returned.
      Parameters:
      serviceURL - the service to register (must not be null)
      Returns:
      the registration handle (not null)
    • registerServices

      public ServiceRegistration registerServices(ServiceURL... serviceURLs)
      Register a group of service URLs to be controlled with a single handle. Any valid service URL may be provided, and the registrations will last until the handle is closed. If the service URL is not supported, the empty registration handle is returned.
      Parameters:
      serviceURLs - the services to register (must not be null or contain null elements)
      Returns:
      the registration handle (not null)