| 1 | package com.hammurapi.eventbus; |
| 2 | |
| 3 | import java.util.Arrays; |
| 4 | |
| 5 | |
| 6 | /** |
| 7 | * This command is posted to execution when event is removed from the bus and there are |
| 8 | * remove handlers matching the event. |
| 9 | * @author Pavel Vlasov |
| 10 | * |
| 11 | * @param <E> |
| 12 | * @param <P> |
| 13 | * @param <C> |
| 14 | * @param <H> |
| 15 | */ |
| 16 | public class RetractCommand<E, P extends Comparable<P>, C, K, H extends EventBus.Handle<E,P,C>, S extends EventStore<E,P,C,H,S>> extends InferenceCommand<E,P,C,K,H,S> { |
| 17 | |
| 18 | private E[] events; |
| 19 | |
| 20 | public RetractCommand( |
| 21 | E[] events, |
| 22 | K handlerId, |
| 23 | EventHandler<E, P, C, H, S> handler, |
| 24 | InferenceContext<E,P,C,K,H,S> inferenceContext) { |
| 25 | super(handlerId, handler,null,inferenceContext); |
| 26 | this.events = events; |
| 27 | } |
| 28 | |
| 29 | public E[] getEvents() { |
| 30 | return events; |
| 31 | } |
| 32 | |
| 33 | @Override |
| 34 | public String toString() { |
| 35 | return "RetractCommand [events=" + Arrays.toString(events) |
| 36 | + ", getHandler()=" + getHandler() + "]"; |
| 37 | } |
| 38 | |
| 39 | |
| 40 | } |
| 41 | |