Package org.wildfly.discovery
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 Summary
Modifier and TypeMethodDescriptionstatic ServiceRegistrycreate(RegistryProvider registryProvider) Create a new service registry instance.static org.wildfly.common.context.ContextManager<ServiceRegistry>Get the context manager.org.wildfly.common.context.ContextManager<ServiceRegistry>Get the instance context manager.registerService(ServiceURL serviceURL) Register a service URL.registerServices(ServiceURL... serviceURLs) Register a group of service URLs to be controlled with a single handle.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.wildfly.common.context.Contextual
run, runAction, runBiConsumer, runBiFunction, runBiPredicate, runCallable, runConsumer, runExBiConsumer, runExBiFunction, runExBiPredicate, runExceptionAction, runExConsumer, runExFunction, runExIntFunction, runExLongFunction, runExPredicate, runFunction, runIntFunction, runLongFunction, runPredicate
-
Method Details
-
getInstanceContextManager
Get the instance context manager. Delegates togetContextManager().- Specified by:
getInstanceContextManagerin interfaceorg.wildfly.common.context.Contextual<ServiceRegistry>- Returns:
- the instance context manager (not
null)
-
getContextManager
Get the context manager.- Returns:
- the context manager (not
null)
-
create
Create a new service registry instance.- Parameters:
registryProvider- the backing registry provider (must not benull)- Returns:
- the new service registry (not
null)
-
registerService
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 benull)- Returns:
- the registration handle (not
null)
-
registerServices
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 benullor containnullelements)- Returns:
- the registration handle (not
null)
-