Package org.eclipse.sisu.osgi
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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionServiceBinding
(org.osgi.framework.BundleContext context, String clazzName, int maxRank, org.osgi.framework.ServiceReference<T> reference) -
Method Summary
Modifier and TypeMethodDescription<V> V
acceptScopingVisitor
(com.google.inject.spi.BindingScopingVisitor<V> visitor) <V> V
acceptTargetVisitor
(com.google.inject.spi.BindingTargetVisitor<? super T, V> visitor) <V> V
acceptVisitor
(com.google.inject.spi.ElementVisitor<V> visitor) void
applyTo
(com.google.inject.Binder binder) get()
com.google.inject.Key<T>
getKey()
com.google.inject.Provider<T>
private static int
getServiceRanking
(org.osgi.framework.ServiceReference<?> reference) (package private) boolean
isCompatibleWith
(BindingSubscriber<T> subscriber) (package private) int
rank()
-
Field Details
-
key
-
instance
-
rank
private final int rank
-
-
Constructor Details
-
ServiceBinding
ServiceBinding(org.osgi.framework.BundleContext context, String clazzName, int maxRank, org.osgi.framework.ServiceReference<T> reference) throws ClassNotFoundException - Throws:
ClassNotFoundException
-
-
Method Details
-
getKey
- Specified by:
getKey
in interfacecom.google.inject.Binding<T>
-
getProvider
- Specified by:
getProvider
in interfacecom.google.inject.Binding<T>
-
get
-
getSource
- Specified by:
getSource
in interfacecom.google.inject.spi.Element
-
applyTo
public void applyTo(com.google.inject.Binder binder) - Specified by:
applyTo
in interfacecom.google.inject.spi.Element
-
acceptVisitor
public <V> V acceptVisitor(com.google.inject.spi.ElementVisitor<V> visitor) - Specified by:
acceptVisitor
in interfacecom.google.inject.spi.Element
-
acceptTargetVisitor
- Specified by:
acceptTargetVisitor
in interfacecom.google.inject.Binding<T>
-
acceptScopingVisitor
public <V> V acceptScopingVisitor(com.google.inject.spi.BindingScopingVisitor<V> visitor) - Specified by:
acceptScopingVisitor
in interfacecom.google.inject.Binding<T>
-
isCompatibleWith
-
rank
int rank() -
getServiceRanking
private static int getServiceRanking(org.osgi.framework.ServiceReference<?> reference)
-