    001    package com.hammurapi.eventbus;
    002
    003    import java.util.Arrays;
    004
    005
    006    /**
    007     * This command is posted to execution when event is removed from the bus and there are
    008     * remove handlers matching the event.
    009     * @author Pavel Vlasov
    010     *
    011     * @param <E>
    012     * @param <P>
    013     * @param <C>
    014     * @param <H>
    015     */
    016    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> {
    017
    018            private E[] events;
    019
    020            public RetractCommand(
    021                            E[] events,
    022                            K handlerId,
    023                            EventHandler<E, P, C, H, S> handler,
    024                            InferenceContext<E,P,C,K,H,S> inferenceContext) {
    025                    super(handlerId, handler,null,inferenceContext);
    026                    this.events = events;
    027            }
    028
    029            public E[] getEvents() {
    030                    return events;
    031            }
    032
    033            @Override
    034            public String toString() {
    035                    return "RetractCommand [events=" + Arrays.toString(events)
    036                                    + ", getHandler()=" + getHandler() + "]";
    037            }
    038
    039
    040    }
    041