1 | package com.hammurapi.eventbus.local; |
2 | |
3 | import java.util.Queue; |
4 | |
5 | import com.hammurapi.eventbus.AbstractEventBus; |
6 | import com.hammurapi.eventbus.AbstractEventBus.Handle; |
7 | import com.hammurapi.eventbus.EventDispatchJoinContext; |
8 | import com.hammurapi.eventbus.EventHandler; |
9 | import com.hammurapi.eventbus.EventHandlerBase; |
10 | import com.hammurapi.eventbus.EventStore; |
11 | import com.hammurapi.eventbus.InferenceCommand; |
12 | import com.hammurapi.eventbus.InferenceContext; |
13 | |
14 | class LocalEventDispatchJoinContextImpl<E, P extends Comparable<P>, C, S extends EventStore<E, P, C, AbstractEventBus.Handle<E, P, C, Long>, S>> extends LocalEventDispatchContextImpl<E,P,C, S> implements EventDispatchJoinContext<E, P, C, AbstractEventBus.Handle<E,P,C,Long>, S> { |
15 | |
16 | EventDispatchJoinContext<E,P,C,AbstractEventBus.Handle<E,P,C,Long>,S> master; |
17 | |
18 | public LocalEventDispatchJoinContextImpl( |
19 | InferenceContext<E, P, C, Long, AbstractEventBus.Handle<E,P,C,Long>, S> inferenceContext, |
20 | EventHandler<E, P, C, AbstractEventBus.Handle<E,P,C,Long>, S> eventHandler, |
21 | Long registrationKey, |
22 | Handle<E, P, C, Long>[] handles, E[] events, |
23 | EventDispatchJoinContext<E,P,C,AbstractEventBus.Handle<E,P,C,Long>,S> master, |
24 | EventHandlerBase.Mode mode) { |
25 | |
26 | super(inferenceContext, eventHandler, registrationKey, handles, events, mode); |
27 | this.master = master; |
28 | } |
29 | |
30 | @Override |
31 | public void consumeJoin(int index) { |
32 | master.consumeJoin(index); |
33 | } |
34 | |
35 | @Override |
36 | public void consumeJoin(E event) { |
37 | master.consumeJoin(event); |
38 | } |
39 | |
40 | @Override |
41 | public void consume(int index) { |
42 | super.consume(index); |
43 | consumeJoin(index); |
44 | } |
45 | |
46 | } |