public interface ServiceConsuming
| Modifier and Type | Method and Description |
|---|---|
<S> de.tototec.utils.functional.Optional<S> |
service(java.lang.Class<S> type)
Returns the highest-ranked service of the specified type if available.
|
<S> de.tototec.utils.functional.Optional<S> |
service(java.lang.Class<S> type,
java.lang.String filter)
Returns the first available service of the specified class which satisfies
the filter if available.
|
<S> de.tototec.utils.functional.Optional<org.osgi.framework.ServiceReference<S>> |
serviceRef(java.lang.Class<? super S> type)
Like
service(Class) but returns the reference so you can access meta
information
about that service. |
<S> de.tototec.utils.functional.Optional<org.osgi.framework.ServiceReference<S>> |
serviceRef(java.lang.Class<S> type,
java.lang.String filter)
Like
service(Class, String) with filter but returns the service
reference. |
<S> java.util.Collection<org.osgi.framework.ServiceReference<S>> |
serviceRefs(java.lang.Class<S> type,
java.lang.String filter)
Like
services(Class, String) with filters but returns the
references. |
<S> java.util.List<S> |
services(java.lang.Class<S> type)
Returns all services of the given type.
|
<S> java.util.List<S> |
services(java.lang.Class<S> type,
java.lang.String filter)
Returns all services of the specified type which satisfy the given filter.
|
<S,R> R |
withService(java.lang.Class<S> type,
de.tototec.utils.functional.F1<de.tototec.utils.functional.Optional<S>,R> f)
Executes the given handler with the highest-ranked service of the specified
type.
|
<S,R> R withService(java.lang.Class<S> type,
de.tototec.utils.functional.F1<de.tototec.utils.functional.Optional<S>,R> f)
BundleContext.ungetService(org.osgi.framework.ServiceReference).f - Handler that uses the service.<S> de.tototec.utils.functional.Optional<org.osgi.framework.ServiceReference<S>> serviceRef(java.lang.Class<? super S> type)
service(Class) but returns the reference so you can access meta
information
about that service. An implicit conversion adds a `service` property to the
reference, so you can simply use that to obtain the service. Doesn't take
type parameters into account!<S> de.tototec.utils.functional.Optional<org.osgi.framework.ServiceReference<S>> serviceRef(java.lang.Class<S> type,
java.lang.String filter)
service(Class, String) with filter but returns the service
reference.<S> java.util.Collection<org.osgi.framework.ServiceReference<S>> serviceRefs(java.lang.Class<S> type,
java.lang.String filter)
services(Class, String) with filters but returns the
references.<S> de.tototec.utils.functional.Optional<S> service(java.lang.Class<S> type)
<S> de.tototec.utils.functional.Optional<S> service(java.lang.Class<S> type,
java.lang.String filter)
filter - filter expression<S> java.util.List<S> services(java.lang.Class<S> type,
java.lang.String filter)
filter - filter expression<S> java.util.List<S> services(java.lang.Class<S> type)