com.hammurapi.eventbus
Class ReflectiveEventHandler<E,C,H extends EventBus.Handle<E,Integer,C>,S extends EventStore<E,Integer,C,H,S>>

Show UML class diagram
java.lang.Object
  extended by com.hammurapi.eventbus.ReflectiveEventHandler<E,C,H,S>
All Implemented Interfaces:
EventHandler<E,Integer,C,H,S>, EventHandlerBase<E,Integer,C>

public final class ReflectiveEventHandler<E,C,H extends EventBus.Handle<E,Integer,C>,S extends EventStore<E,Integer,C,H,S>>
extends Object
implements EventHandler<E,Integer,C,H,S>


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.hammurapi.eventbus.EventHandlerBase
EventHandlerBase.Mode
 
Method Summary
 boolean consumes()
           
 int getCardinality()
           
 C getContext()
           
 C getInstance()
           
 Method getMethod()
           
 EventHandlerBase.Mode getMode()
          Handler mode.
  getPredicate()
           
 Integer getPriority()
           
 boolean isOneOff()
          If this method returns true, then handler is invoked only once and then is removed from the bus.
 void post(EventDispatchContext<E,Integer,C,H,S> context, E... events)
          Posts event for handling.
 void reset()
          Resets handler internal state, if any.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getMethod

public Method getMethod()

getInstance

public C getInstance()

consumes

public boolean consumes()
Specified by:
consumes in interface EventHandlerBase<E,Integer,C>
Returns:
true if this handler consumes or updates events.

getCardinality

public int getCardinality()
Specified by:
getCardinality in interface EventHandlerBase<E,Integer,C>
Returns:
Number of parameters expected by this handler.

getContext

public C getContext()
Specified by:
getContext in interface EventHandlerBase<E,Integer,C>
Returns:
Context for predicates.

getPriority

public Integer getPriority()
Specified by:
getPriority in interface EventHandlerBase<E,Integer,C>
Returns:
priority Handler priority. Handlers with higher priority are guaranteed to be executed before handlers with lower priority and as such can consume events and prevent their dispatching to other handlers.

post

public void post(EventDispatchContext<E,Integer,C,H,S> context,
                 E... events)
Description copied from interface: EventHandler
Posts event for handling.

Specified by:
post in interface EventHandler<E,Integer,C,H extends EventBus.Handle<E,Integer,C>,S extends EventStore<E,Integer,C,H,S>>
Parameters:
context - Event dispatching context.
events - Events to handle. An event to handle if there is one event. A tuple of joined events to handle otherwise.

reset

public void reset()
Description copied from interface: EventHandlerBase
Resets handler internal state, if any.

Specified by:
reset in interface EventHandlerBase<E,Integer,C>

toString

public String toString()
Overrides:
toString in class Object

isOneOff

public boolean isOneOff()
Description copied from interface: EventHandlerBase
If this method returns true, then handler is invoked only once and then is removed from the bus.

Specified by:
isOneOff in interface EventHandlerBase<E,Integer,C>
Returns:

getMode

public EventHandlerBase.Mode getMode()
Description copied from interface: EventHandlerBase
Handler mode.

Specified by:
getMode in interface EventHandlerBase<E,Integer,C>
Returns:

getPredicate

public  getPredicate()
Specified by:
getPredicate in interface EventHandlerBase<E,Integer,C>
Returns:
Handler predicates.