Class ServiceBinding<T>

java.lang.Object
org.eclipse.sisu.osgi.ServiceBinding<T>
All Implemented Interfaces:
com.google.inject.Binding<T>, com.google.inject.Provider<T>, com.google.inject.spi.Element, javax.inject.Provider<T>

final class ServiceBinding<T> extends Object implements com.google.inject.Binding<T>, com.google.inject.Provider<T>
Service Binding backed by an OSGi ServiceReference.
  • Field Details

    • key

      private final com.google.inject.Key<T> key
    • instance

      private final T instance
    • rank

      private final int rank
  • Constructor Details

  • Method Details

    • getKey

      public com.google.inject.Key<T> getKey()
      Specified by:
      getKey in interface com.google.inject.Binding<T>
    • getProvider

      public com.google.inject.Provider<T> getProvider()
      Specified by:
      getProvider in interface com.google.inject.Binding<T>
    • get

      public T get()
      Specified by:
      get in interface com.google.inject.Provider<T>
      Specified by:
      get in interface javax.inject.Provider<T>
    • getSource

      public Object getSource()
      Specified by:
      getSource in interface com.google.inject.spi.Element
    • applyTo

      public void applyTo(com.google.inject.Binder binder)
      Specified by:
      applyTo in interface com.google.inject.spi.Element
    • acceptVisitor

      public <V> V acceptVisitor(com.google.inject.spi.ElementVisitor<V> visitor)
      Specified by:
      acceptVisitor in interface com.google.inject.spi.Element
    • acceptTargetVisitor

      public <V> V acceptTargetVisitor(com.google.inject.spi.BindingTargetVisitor<? super T,V> visitor)
      Specified by:
      acceptTargetVisitor in interface com.google.inject.Binding<T>
    • acceptScopingVisitor

      public <V> V acceptScopingVisitor(com.google.inject.spi.BindingScopingVisitor<V> visitor)
      Specified by:
      acceptScopingVisitor in interface com.google.inject.Binding<T>
    • isCompatibleWith

      boolean isCompatibleWith(BindingSubscriber<T> subscriber)
    • rank

      int rank()
    • getServiceRanking

      private static int getServiceRanking(org.osgi.framework.ServiceReference<?> reference)