Class ServiceBindings

java.lang.Object
org.eclipse.sisu.osgi.ServiceBindings
All Implemented Interfaces:
BindingPublisher

public final class ServiceBindings extends Object implements BindingPublisher
On-demand publisher of Bindings from the OSGi service registry.
  • Constructor Summary

    Constructors
    Constructor
    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).
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
     
    static String
     
    int
    Estimates the maximum rank this publisher may assign to a Binding.
    <T> void
    Subscribes the given BindingSubscriber to receive Bindings.
    <T> void
    Stops the given BindingSubscriber from receiving Bindings.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ServiceBindings

      public 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).
      Parameters:
      context - The tracking context
      allow - Globbed pattern of packages/types to allow
      ignore - Globbed pattern of packages/types to ignore
      maxRank - Maximum binding rank
    • ServiceBindings

      public 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.
      Parameters:
      context - The tracking context
  • Method Details