public final class ServiceManager extends Object implements ServiceManager
public static ServiceManager getInstance()
public ServiceDescriptor[] getServiceDescriptors()
public ServiceDescriptor getServiceDescriptor(Class<?> serviceClass)
public ServiceDescriptor getServiceDescriptor(String serviceClass)
public ServiceDescriptor getServiceDescriptor(Class<?> serviceClass, String name)
public ServiceDescriptor getServiceDescriptor(String serviceClass, String name)
public void registerService(ServiceDescriptor sd)
public void unregisterService(ServiceDescriptor sd)
public <T> T getService(Class<T> serviceClass) throws Exception
ServiceManager
getService
in interface ServiceManager
serviceClass
- the service interface classException
public <T> T getService(Class<T> serviceClass, String name) throws Exception
ServiceManager
This is useful to lookup services that are not singletons and can be identified using a service name.
getService
in interface ServiceManager
serviceClass
- the service interface classname
- the service nameException
public Object getService(String serviceUri) throws Exception
This is a dynamic lookup in the sense that the service bindings should not be registered through extension points but all the information about how to locate the service are passed through the URI.
This method is not portable since the URI depends on the target server and configuration. Examples of service URIs:
jboss://localhost:1099/nuxeo/TypeManagerBean/remote
-
locate a service on jbossglassfish://localhost:1234/org.nuxeo.ecm.platform.types.TypeManager
-
locate a service on glassfishserviceUri
- the service uriException
public ServiceGroup getOrCreateGroup(String name)
public ServiceGroup getGroup(String name)
public void removeGroup(String name)
public void addGroup(String name)
public ServiceGroup getRootGroup()
public void registerServer(ServiceHost server)
public void unregisterServer(ServiceHost server)
public void removeServers()
public void removeServices()
public void removeGroups()
public void reset()
public ServiceHost[] getServers()
Copyright © 2011 Nuxeo SA. All Rights Reserved.