@ParametersAreNonnullByDefault public class OSGiContext extends Object implements ServiceContext
ServiceContext able to retrieve OSGi Declarative Services from a BundleContext.
NOTE: This context is automatically loaded and configured when this bundle is starting under an OSGi environment.| Constructor and Description |
|---|
OSGiContext() |
| Modifier and Type | Method and Description |
|---|---|
<S> Stream<ServiceDefinition<S>> |
getServices(Class<S> type)
Retrieves all registered services of the specified
type. |
<T> Stream<ServiceDefinition<T>> |
getServices(Class<T> type,
String filter)
Retrieves all registered services of the specified
type. |
@Nonnull public <S> Stream<ServiceDefinition<S>> getServices(Class<S> type)
ServiceContexttype.getServices in interface ServiceContexttype - the type of services to look fortype@Nonnull public <T> Stream<ServiceDefinition<T>> getServices(Class<T> type, @Nullable String filter)
type.type - the type of services to look forfilter - the filter to determine if a service should be returnedtypeCopyright © 2017–2019 Atlanmod. All rights reserved.