Package org.jboss.msc.service
Class DelegatingServiceRegistry
- java.lang.Object
-
- org.jboss.msc.service.DelegatingServiceRegistry
-
- All Implemented Interfaces:
ServiceRegistry
public final class DelegatingServiceRegistry extends java.lang.Object implements ServiceRegistry
An "insulated" view of a service registry which prevents access to other public methods on the delegate registry object.
-
-
Field Summary
Fields Modifier and Type Field Description private ServiceRegistrydelegate
-
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 ServiceController<?>getRequiredService(ServiceName serviceName)Get a service, throwing an exception if it is not found.ServiceController<?>getService(ServiceName serviceName)Get a service, returningnullif it is not found.java.util.List<ServiceName>getServiceNames()Get a list of service names installed in this registry.
-
-
-
Field Detail
-
delegate
private final ServiceRegistry delegate
-
-
Constructor Detail
-
DelegatingServiceRegistry
public DelegatingServiceRegistry(ServiceRegistry delegate)
Construct a new instance.- Parameters:
delegate- the registry to delegate to
-
-
Method Detail
-
getRequiredService
public ServiceController<?> getRequiredService(ServiceName serviceName) throws ServiceNotFoundException
Get a service, throwing an exception if it is not found.- Specified by:
getRequiredServicein 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, returningnullif it is not found.- Specified by:
getServicein interfaceServiceRegistry- Parameters:
serviceName- the service name- Returns:
- the service controller for the corresponding service, or
nullif it is not found
-
getServiceNames
public java.util.List<ServiceName> getServiceNames()
Get a list of service names installed in this registry.- Specified by:
getServiceNamesin interfaceServiceRegistry- Returns:
- the list
-
-