Accessing the service manager

All services are created and maintained by a single service manager (which implements the com.ibm.hats.runtime.services.IServiceManager interface). Service objects should not be constructed outside of the service manager. The following code sample shows how to access the service manager:
IServiceManager serviceManager = RcpRuntimePlugin.getDefault().getServiceManager();
Table 1 identifies the methods that can be called by the IServiceManager object.
Table 1. IServiceManager methods
Method Description
addServiceManagerListener(ServiceManagerListener) Adds a listener to this service manager.
removeServiceManagerListener(ServiceManagerListener) Removes a listener from this service manager.
getApplicationService(String) Returns the IApplicationService corresponding to the specified application plug-in ID.
getClientService(String) Returns the IClientService corresponding to the specified client ID (in the rich client, the client ID is always the value of RcpRuntimeService.rcpClientId).
getRuntimeService() Returns the IRuntimeService for the environment.
getSessionService(String, String, String) Returns the ISessionService corresponding to the specified client ID, application plug-in ID, and view ID.
getServiceIDs(ServiceType) Returns a set of IDs corresponding to services managed by this service manager with the specified service type getServiceEntryCount(ServiceType).
getServiceEntryCount(ServiceType) Returns the number of services managed by this service manager with the specified type.
See the com.ibm.hats.runtime.services.IServiceManager API for more information.