Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.runtime.api
Class ServiceManager

java.lang.Object
  extended by org.nuxeo.runtime.api.ServiceManager
All Implemented Interfaces:
ServiceManager

public final class ServiceManager
extends Object
implements ServiceManager

Author:
Bogdan Stefanescu

Method Summary
 void addGroup(String name)
           
 ServiceGroup getGroup(String name)
           
static ServiceManager getInstance()
           
 ServiceGroup getOrCreateGroup(String name)
           
 ServiceGroup getRootGroup()
           
 ServiceHost[] getServers()
           
<T> T
getService(Class<T> serviceClass)
          Gets a service implementation given the interface class.
<T> T
getService(Class<T> serviceClass, String name)
          Gets a service implementation given the interface class and a name.
 Object getService(String serviceUri)
          Dynamically lookup services given a service URI.
 ServiceDescriptor getServiceDescriptor(Class<?> serviceClass)
           
 ServiceDescriptor getServiceDescriptor(Class<?> serviceClass, String name)
           
 ServiceDescriptor getServiceDescriptor(String serviceClass)
           
 ServiceDescriptor getServiceDescriptor(String serviceClass, String name)
           
 ServiceDescriptor[] getServiceDescriptors()
           
 void registerServer(ServiceHost server)
           
 void registerService(ServiceDescriptor sd)
           
 void removeGroup(String name)
           
 void removeGroups()
           
 void removeServers()
          Removes all registered servers.
 void removeServices()
           
 void reset()
           
 void unregisterServer(ServiceHost server)
           
 void unregisterService(ServiceDescriptor sd)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ServiceManager getInstance()

getServiceDescriptors

public ServiceDescriptor[] getServiceDescriptors()

getServiceDescriptor

public ServiceDescriptor getServiceDescriptor(Class<?> serviceClass)

getServiceDescriptor

public ServiceDescriptor getServiceDescriptor(String serviceClass)

getServiceDescriptor

public ServiceDescriptor getServiceDescriptor(Class<?> serviceClass,
                                              String name)

getServiceDescriptor

public ServiceDescriptor getServiceDescriptor(String serviceClass,
                                              String name)

registerService

public void registerService(ServiceDescriptor sd)

unregisterService

public void unregisterService(ServiceDescriptor sd)

getService

public <T> T getService(Class<T> serviceClass)
             throws Exception
Description copied from interface: ServiceManager
Gets a service implementation given the interface class.

Specified by:
getService in interface ServiceManager
Parameters:
serviceClass - the service interface class
Returns:
the implementation
Throws:
Exception

getService

public <T> T getService(Class<T> serviceClass,
                        String name)
             throws Exception
Description copied from interface: ServiceManager
Gets a service implementation given the interface class and a name.

This is useful to lookup services that are not singletons and can be identified using a service name.

Specified by:
getService in interface ServiceManager
Parameters:
serviceClass - the service interface class
name - the service name
Returns:
the implementation
Throws:
Exception

getService

public Object getService(String serviceUri)
                  throws Exception
Dynamically lookup services given a service URI.

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:

Parameters:
serviceUri - the service uri
Returns:
the service
Throws:
Exception

getOrCreateGroup

public ServiceGroup getOrCreateGroup(String name)

getGroup

public ServiceGroup getGroup(String name)

removeGroup

public void removeGroup(String name)

addGroup

public void addGroup(String name)

getRootGroup

public ServiceGroup getRootGroup()

registerServer

public void registerServer(ServiceHost server)

unregisterServer

public void unregisterServer(ServiceHost server)

removeServers

public void removeServers()
Removes all registered servers.


removeServices

public void removeServices()

removeGroups

public void removeGroups()

reset

public void reset()

getServers

public ServiceHost[] getServers()

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.