Package org.eclipse.sisu.inject
Class RankedBindings<T>
- java.lang.Object
-
- org.eclipse.sisu.inject.RankedBindings<T>
-
- All Implemented Interfaces:
java.lang.Iterable<com.google.inject.Binding<T>>,BindingSubscriber<T>
final class RankedBindings<T> extends java.lang.Object implements java.lang.Iterable<com.google.inject.Binding<T>>, BindingSubscriber<T>
Ordered sequence ofBindings of a given type; subscribes toBindingPublishers on demand.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classRankedBindings.ItrBindingiterator that only subscribes toBindingPublishers as required.
-
Field Summary
Fields Modifier and Type Field Description (package private) RankedSequence<com.google.inject.Binding<T>>bindings(package private) java.util.Collection<BeanCache<?,T>>cachedBeans(package private) RankedSequence<BindingPublisher>pendingPublishers(package private) com.google.inject.TypeLiteral<T>type
-
Constructor Summary
Constructors Constructor Description RankedBindings(com.google.inject.TypeLiteral<T> type, RankedSequence<BindingPublisher> publishers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(com.google.inject.Binding<T> binding, int rank)Adds the given rankedBindingto this subscriber.(package private) voidadd(BindingPublisher publisher, int rank)java.lang.Iterable<com.google.inject.Binding<T>>bindings()Snapshot of currently subscribedBindings.RankedBindings.Itriterator()(package private) <Q extends java.lang.annotation.Annotation>
BeanCache<Q,T>newBeanCache()voidremove(com.google.inject.Binding<T> binding)Removes the givenBindingfrom this subscriber.(package private) voidremove(BindingPublisher publisher)com.google.inject.TypeLiteral<T>type()Returns the type ofBindings that are of interest.
-
-
-
Field Detail
-
bindings
final transient RankedSequence<com.google.inject.Binding<T>> bindings
-
type
final transient com.google.inject.TypeLiteral<T> type
-
pendingPublishers
final transient RankedSequence<BindingPublisher> pendingPublishers
-
-
Constructor Detail
-
RankedBindings
RankedBindings(com.google.inject.TypeLiteral<T> type, RankedSequence<BindingPublisher> publishers)
-
-
Method Detail
-
type
public com.google.inject.TypeLiteral<T> type()
Description copied from interface:BindingSubscriberReturns the type ofBindings that are of interest.- Specified by:
typein interfaceBindingSubscriber<T>- Returns:
- The literal type
-
add
public void add(com.google.inject.Binding<T> binding, int rank)
Description copied from interface:BindingSubscriberAdds the given rankedBindingto this subscriber.- Specified by:
addin interfaceBindingSubscriber<T>- Parameters:
binding- The new bindingrank- The assigned rank
-
remove
public void remove(com.google.inject.Binding<T> binding)
Description copied from interface:BindingSubscriberRemoves the givenBindingfrom this subscriber.- Specified by:
removein interfaceBindingSubscriber<T>- Parameters:
binding- The old binding
-
bindings
public java.lang.Iterable<com.google.inject.Binding<T>> bindings()
Description copied from interface:BindingSubscriberSnapshot of currently subscribedBindings.- Specified by:
bindingsin interfaceBindingSubscriber<T>- Returns:
- The subscribed
Bindings
-
iterator
public RankedBindings.Itr iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<T>
-
add
void add(BindingPublisher publisher, int rank)
-
remove
void remove(BindingPublisher publisher)
-
-