Package com.lmax.disruptor.dsl
Class ConsumerRepository<T>
- java.lang.Object
-
- com.lmax.disruptor.dsl.ConsumerRepository<T>
-
- Type Parameters:
T- the type of theEventHandler
- All Implemented Interfaces:
java.lang.Iterable<ConsumerInfo>
class ConsumerRepository<T> extends java.lang.Object implements java.lang.Iterable<ConsumerInfo>
Provides a repository mechanism to associateEventHandlers withEventProcessors
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Collection<ConsumerInfo>consumerInfosprivate java.util.Map<EventHandler<?>,EventProcessorInfo<T>>eventProcessorInfoByEventHandlerprivate java.util.Map<Sequence,ConsumerInfo>eventProcessorInfoBySequence
-
Constructor Summary
Constructors Constructor Description ConsumerRepository()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(EventProcessor processor)voidadd(EventProcessor eventprocessor, EventHandler<? super T> handler, SequenceBarrier barrier)voidadd(WorkerPool<T> workerPool, SequenceBarrier sequenceBarrier)SequenceBarriergetBarrierFor(EventHandler<T> handler)EventProcessorgetEventProcessorFor(EventHandler<T> handler)private EventProcessorInfo<T>getEventProcessorInfo(EventHandler<T> handler)private ConsumerInfogetEventProcessorInfo(Sequence barrierEventProcessor)Sequence[]getLastSequenceInChain(boolean includeStopped)SequencegetSequenceFor(EventHandler<T> handler)java.util.Iterator<ConsumerInfo>iterator()voidunMarkEventProcessorsAsEndOfChain(Sequence... barrierEventProcessors)
-
-
-
Field Detail
-
eventProcessorInfoByEventHandler
private final java.util.Map<EventHandler<?>,EventProcessorInfo<T>> eventProcessorInfoByEventHandler
-
eventProcessorInfoBySequence
private final java.util.Map<Sequence,ConsumerInfo> eventProcessorInfoBySequence
-
consumerInfos
private final java.util.Collection<ConsumerInfo> consumerInfos
-
-
Method Detail
-
add
public void add(EventProcessor eventprocessor, EventHandler<? super T> handler, SequenceBarrier barrier)
-
add
public void add(EventProcessor processor)
-
add
public void add(WorkerPool<T> workerPool, SequenceBarrier sequenceBarrier)
-
getLastSequenceInChain
public Sequence[] getLastSequenceInChain(boolean includeStopped)
-
getEventProcessorFor
public EventProcessor getEventProcessorFor(EventHandler<T> handler)
-
getSequenceFor
public Sequence getSequenceFor(EventHandler<T> handler)
-
unMarkEventProcessorsAsEndOfChain
public void unMarkEventProcessorsAsEndOfChain(Sequence... barrierEventProcessors)
-
iterator
public java.util.Iterator<ConsumerInfo> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<T>
-
getBarrierFor
public SequenceBarrier getBarrierFor(EventHandler<T> handler)
-
getEventProcessorInfo
private EventProcessorInfo<T> getEventProcessorInfo(EventHandler<T> handler)
-
getEventProcessorInfo
private ConsumerInfo getEventProcessorInfo(Sequence barrierEventProcessor)
-
-