JBoss Modular Service Kernel API 1.0.0.CR2

org.jboss.msc.service
Class DelegatingServiceRegistry

java.lang.Object
  extended by org.jboss.msc.service.DelegatingServiceRegistry
All Implemented Interfaces:
ServiceRegistry

public final class DelegatingServiceRegistry
extends Object
implements ServiceRegistry

An "insulated" view of a service registry which prevents access to other public methods on the delegate registry object.

Author:
David M. Lloyd

Constructor Summary
DelegatingServiceRegistry(ServiceRegistry delegate)
          Construct a new instance.
 
Method Summary
 ServiceController<?> getRequiredService(ServiceName serviceName)
          Get a service, throwing an exception if it is not found.
 ServiceController<?> getService(ServiceName serviceName)
          Get a service, returning null if it is not found.
 List<ServiceName> getServiceNames()
          Get a list of service names installed in this registry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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:
getRequiredService in interface ServiceRegistry
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, returning null if it is not found.

Specified by:
getService in interface ServiceRegistry
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 interface ServiceRegistry
Returns:
the list

JBoss Modular Service Kernel API 1.0.0.CR2

Copyright © 2011 JBoss, a division of Red Hat, Inc.