1 | package com.hammurapi.eventbus; |
2 | |
3 | import com.hammurapi.eventbus.EventHandlerBase.Mode; |
4 | import com.hammurapi.extract.Predicate; |
5 | |
6 | public class EventDispatchJoinContextFilter<E, P extends Comparable<P>, C, H extends EventBus.Handle<E,P,C>, S extends EventStore<E,P,C,H,S>> implements EventDispatchJoinContext<E,P,C,H,S> { |
7 | |
8 | protected EventDispatchContext<E,P,C,H,S> next; |
9 | |
10 | public EventDispatchJoinContextFilter(EventDispatchContext<E,P,C,H,S> next) { |
11 | this.next = next; |
12 | } |
13 | |
14 | public void consume(int index) { |
15 | next.consume(index); |
16 | } |
17 | |
18 | public void consume(E event) { |
19 | next.consume(event); |
20 | } |
21 | |
22 | // public <T extends E, S extends T> void substitute(T oldEvent, S newEvent) { |
23 | // next.substitute(oldEvent, newEvent); |
24 | // } |
25 | |
26 | public void update(E event) { |
27 | next.update(event); |
28 | } |
29 | |
30 | public void removeHandler() { |
31 | next.removeHandler(); |
32 | } |
33 | |
34 | @Override |
35 | public void consumeJoin(int index) { |
36 | ((EventDispatchJoinContext<E,P,C,H,S>) next).consumeJoin(index); |
37 | } |
38 | |
39 | @Override |
40 | public void consumeJoin(E event) { |
41 | ((EventDispatchJoinContext<E,P,C,H,S>) next).consumeJoin(event); |
42 | } |
43 | |
44 | @Override |
45 | public S getEventStore() { |
46 | return next.getEventStore(); |
47 | } |
48 | |
49 | @Override |
50 | public void post(E event, Predicate<E, S>... validators) { |
51 | next.post(event, validators); |
52 | } |
53 | |
54 | @Override |
55 | public Mode getMode() { |
56 | return next.getMode(); |
57 | } |
58 | |
59 | } |