public final class ServiceBindings extends Object implements BindingPublisher
Bindings from the OSGi service registry.| Constructor and Description |
|---|
ServiceBindings(org.osgi.framework.BundleContext context)
Creates new publisher of service bindings, using the given OSGi
BundleContext to track services.Uses default allow/ignore settings and assigns any published services the lowest possible ranking. |
ServiceBindings(org.osgi.framework.BundleContext context,
String allow,
String ignore,
int maxRank)
Creates new publisher of service bindings, using the given OSGi
BundleContext to track services.The globbed patterns control whether tracking requests for particular types are allowed or ignored. Any published bindings are ranked according to their service ranking (up to the given maximum). |
| Modifier and Type | Method and Description |
|---|---|
static String |
defaultAllow() |
static String |
defaultIgnore() |
int |
maxBindingRank()
Estimates the maximum rank this publisher may assign to a
Binding. |
<T> void |
subscribe(BindingSubscriber<T> subscriber)
Subscribes the given
BindingSubscriber to receive Bindings. |
<T> void |
unsubscribe(BindingSubscriber<T> subscriber)
Stops the given
BindingSubscriber from receiving Bindings. |
public ServiceBindings(org.osgi.framework.BundleContext context,
String allow,
String ignore,
int maxRank)
BundleContext to track services.context - The tracking contextallow - Globbed pattern of packages/types to allowignore - Globbed pattern of packages/types to ignoremaxRank - Maximum binding rankpublic ServiceBindings(org.osgi.framework.BundleContext context)
BundleContext to track services.context - The tracking contextpublic static String defaultAllow()
org.eclipse.sisu.osgi.ServiceBindings.allow} system propertypublic static String defaultIgnore()
org.eclipse.sisu.osgi.ServiceBindings.ignore} system propertypublic <T> void subscribe(BindingSubscriber<T> subscriber)
BindingPublisherBindingSubscriber to receive Bindings.subscribe in interface BindingPublishersubscriber - The subscriberpublic <T> void unsubscribe(BindingSubscriber<T> subscriber)
BindingPublisherBindingSubscriber from receiving Bindings.unsubscribe in interface BindingPublishersubscriber - The subscriberpublic int maxBindingRank()
BindingPublisherBinding.maxBindingRank in interface BindingPublisherCopyright © 2016. All Rights Reserved.