Package org.jboss.msc.service
Class DelegatingServiceRegistry
- java.lang.Object
-
- org.jboss.msc.service.DelegatingServiceRegistry
-
- All Implemented Interfaces:
ServiceRegistry
public class DelegatingServiceRegistry extends Object implements ServiceRegistry
A service registry which delegates to another service registry.- Author:
- David M. Lloyd, Richard Opalka
-
-
Constructor Summary
Constructors Constructor Description DelegatingServiceRegistry(ServiceRegistry delegate)
Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ServiceRegistry
getDelegate()
Get the ServiceRegistry delegate.ServiceController<?>
getRequiredService(ServiceName serviceName)
Get a service, throwing an exception if it is not found.ServiceController<?>
getService(ServiceName serviceName)
Get a service, returningnull
if it is not found.List<ServiceName>
getServiceNames()
Get a list of service names installed in this registry.
-
-
-
Constructor Detail
-
DelegatingServiceRegistry
public DelegatingServiceRegistry(ServiceRegistry delegate)
Construct a new instance.- Parameters:
delegate
- the registry to delegate to
-
-
Method Detail
-
getDelegate
protected ServiceRegistry getDelegate()
Get the ServiceRegistry delegate.- Returns:
- ServiceRegistry delegate
-
getRequiredService
public ServiceController<?> getRequiredService(ServiceName serviceName) throws ServiceNotFoundException
Get a service, throwing an exception if it is not found.- Specified by:
getRequiredService
in interfaceServiceRegistry
- Parameters:
serviceName
- the service name- Returns:
- the service controller for the corresponding service
- Throws:
ServiceNotFoundException
- if the service is not present in the registry
-
getService
public ServiceController<?> getService(ServiceName serviceName)
Get a service, returningnull
if it is not found.- Specified by:
getService
in interfaceServiceRegistry
- Parameters:
serviceName
- the service name- Returns:
- the service controller for the corresponding service, or
null
if it is not found
-
getServiceNames
public List<ServiceName> getServiceNames()
Get a list of service names installed in this registry.- Specified by:
getServiceNames
in interfaceServiceRegistry
- Returns:
- the list
-
-