Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.hammurapi.eventbus
Class AbstractEventHandler<E,P extends Comparable<P>,C,H extends EventBus.Handle<E,P,C>,S extends EventStore<E,P,C,H,S>>

Show UML class diagram

    java.lang.Object
      com.hammurapi.eventbus.AbstractEventHandler<E,P,C,H,S>

Type Parameters:
  `E` -
  `P` -
  `C` -

All Implemented Interfaces:
  EventHandler<E,P,C,H,S>, EventHandlerBase<E,P,C>

Direct Known Subclasses:
  EventHandlerFilter, LocalAbstractEventHandler

    public abstract class AbstractEventHandler<E,P extends Comparable<P>,C,H extends EventBus.Handle<E,P,C>,S extends EventStore<E,P,C,H,S>>

extends Object
implements EventHandler<E,P,C,H,S>

Base class for event handlers.

Nested Class Summary

Nested classes/interfaces inherited from interface com.hammurapi.eventbus.EventHandlerBase
`EventHandlerBase.Mode`

Constructor Summary
`AbstractEventHandler()`
`AbstractEventHandler(int cardinality, P priority, C context, boolean consumes, boolean oneOff, EventHandlerBase.Mode mode, ... predicates)`
`AbstractEventHandler(int cardinality, P priority, C context, boolean consumes, boolean oneOff, EventHandlerBase.Mode mode, predicate)`

Method Summary
`boolean` | `consumes()`
`int` | `getCardinality()`
`C` | `getContext()`
`EventHandlerBase.Mode` | `getMode()` Handler mode.
`` | `getPredicate()`
`P` | `getPriority()`
`boolean` | `isOneOff()` If this method returns true, then handler is invoked only once and then is removed from the bus.
`void` | `reset()` Resets handler internal state, if any.
`void` | `setCardinality(int cardinality)`
`void` | `setConsumes(boolean consumes)`
`void` | `setContext(C context)`
`void` | `setMode(EventHandlerBase.Mode mode)`
`void` | `setOneOff(boolean oneOff)`
`void` | `setPredicate( predicate)`
`void` | `setPriority(P priority)`
`String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface com.hammurapi.eventbus.EventHandler
`post`

Constructor Detail

### AbstractEventHandler

    public AbstractEventHandler()

### AbstractEventHandler

    public AbstractEventHandler(int cardinality,
                                P priority,
                                C context,
                                boolean consumes,
                                boolean oneOff,
                                EventHandlerBase.Mode mode,
                                 predicate)

### AbstractEventHandler

    public AbstractEventHandler(int cardinality,
                                P priority,
                                C context,
                                boolean consumes,
                                boolean oneOff,
                                EventHandlerBase.Mode mode,
                                ... predicates)

Method Detail

### setCardinality

    public void setCardinality(int cardinality)

### setConsumes

    public void setConsumes(boolean consumes)

### setContext

    public void setContext(C context)

### setPriority

    public void setPriority(P priority)

### consumes

    public boolean consumes()

  Specified by:
    `consumes` in interface `EventHandlerBase<E,P extends Comparable<P>,C>`
  Returns:
    true if this handler consumes or updates events.

### getPriority

    public P getPriority()

  Specified by:
    `getPriority` in interface `EventHandlerBase<E,P extends Comparable<P>,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.

### getCardinality

    public int getCardinality()

  Specified by:
    `getCardinality` in interface `EventHandlerBase<E,P extends Comparable<P>,C>`
  Returns:
    Number of parameters expected by this handler.

### reset

    public void reset()

  Description copied from interface: `EventHandlerBase`
  Resets handler internal state, if any.

  Specified by:
    `reset` in interface `EventHandlerBase<E,P extends Comparable<P>,C>`

### getContext

    public C getContext()

  Specified by:
    `getContext` in interface `EventHandlerBase<E,P extends Comparable<P>,C>`
  Returns:
    Context for predicates.

### 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,P extends Comparable<P>,C>`
  Returns:

### setOneOff

    public void setOneOff(boolean oneOff)

### getMode

    public EventHandlerBase.Mode getMode()

  Description copied from interface: `EventHandlerBase`
  Handler mode.

  Specified by:
    `getMode` in interface `EventHandlerBase<E,P extends Comparable<P>,C>`
  Returns:

### setMode

    public void setMode(EventHandlerBase.Mode mode)

### getPredicate

    public  getPredicate()

  Specified by:
    `getPredicate` in interface `EventHandlerBase<E,P extends Comparable<P>,C>`
  Returns:
    Handler predicates.

### setPredicate

    public void setPredicate( predicate)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD