001    package com.hammurapi.eventbus;
002    
003    /**
004     * Event handler.
005     * @author Pavel Vlasov.
006     * @param <E> Event type.
007     * @param <P> Priority type.
008     */
009    public interface EventHandler<E, P extends Comparable<P>, C, H extends EventBus.Handle<E,P,C>, S extends EventStore<E,P,C,H,S>> extends EventHandlerBase<E, P, C> {
010            
011            /**
012             * Posts event for handling.
013             * @param context Event dispatching context. 
014             * @param events Events to handle. An event to handle if there is one event. 
015             * A tuple of joined events to handle otherwise.
016             * @return Events to post to the bus as a result of event handling.
017             */
018            void post(EventDispatchContext<E,P,C,H,S> context, E... events);
019            
020    }