Methods
(static) getService(…classOrNames) → {*|null}
Gets a service registered with OSGi. Allows providing multiple classes/names to try for lookup.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
classOrNames |
Array.<(String|JavaClass)> |
<repeatable> |
the class of the service to get |
Throws:
-
if no services of the requested type(s) can be found
- Type
- Error
Returns:
an instance of the service, or null
if it cannot be found
- Type
- * | null
(static) findServices(className, filteropt) → {Array.<*>}
Finds services registered with OSGi.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
className |
string | the class of the service to get |
|
filter |
* |
<optional> |
an optional filter used to filter the returned services |
Returns:
any instances of the service that can be found
- Type
- Array.<*>