public interface IServiceLocator
A component with which one or more services are registered. The services can be retrieved from this locator using some key -- typically the class representing the interface the service must implement. For example:
IHandlerService service = workbenchWindow.getService(IHandlerService.class);
This interface is not to be implemented or extended by clients.
Modifier and Type | Method and Description |
---|---|
<T> T |
getService(Class<T> api)
Retrieves the service corresponding to the given API.
|
boolean |
hasService(Class<?> api)
Whether this service exists within the scope of this service locator.
|
<T> T getService(Class<T> api)
api
- This is the interface that the service implements. Must not be
null
.null
if no such service could be
found.boolean hasService(Class<?> api)
api
- This is the interface that the service implements. Must not be
null
.true
if the service locator can find a service for
the given API; false
otherwise.
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.