001    package com.hammurapi.eventbus;
002    
003    import java.util.Queue;
004    
005    import com.hammurapi.common.ExceptionHandler;
006    import com.hammurapi.common.concurrent.TrackingExecutorService;
007    import com.hammurapi.eventbus.AbstractEventBus.Handle;
008    
009    /**
010     * Wrapper interface.
011     * @author Pavel Vlasov
012     *
013     * @param <E>
014     * @param <P>
015     */
016    public interface JoinEventHandler<E, P extends Comparable<P>, C, K, H extends EventBus.Handle<E, P, C>, S extends EventStore<E,P,C,H,S>> extends EventHandlerBase<E, P, C> {
017    
018            /**
019             * Posts event for handling.
020             * @param context Event dispatching context. 
021             * @param events Events to handle. An event to handle if there is one event. 
022             * A tuple of joined events to handle otherwise.
023             * @return Events to post to the bus as a result of event handling.
024             */
025            void post(
026                            EventDispatchContext<E,P,C,H,S> context, 
027                            InferenceContext<E,P,C,K,H,S> inferenceContext,
028                            Handle<E,P,C,K>[]... events);
029                    
030    }