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 EventHandlerWrapperFilter<E,P extends Comparable<P>,C,K,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.EventHandlerWrapperFilter<E,P,C,K,H,S>

Type Parameters:
  `E` -
  `P` -

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

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

extends Object
implements EventHandlerWrapper<E,P,C,K,H,S>

Wrapper interface.

Nested Class Summary

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

Constructor Summary
`EventHandlerWrapperFilter(EventHandlerWrapper<E,P,C,K,H,S> master, predicate)`

Method Summary
`boolean` | `consumes()`
`int` | `getCardinality()`
`C` | `getContext()`
`EventHandler<E,P,C,H,S>` | `getHandler()`
`EventHandlerWrapper<E,P,C,K,H,S>` | `getMaster()`
`EventHandlerBase.Mode` | `getMode()` Handler mode.
`` | `getPredicate()` Predicate which was used during registration.
`P` | `getPriority()`
`Set<K>` | `getRegistrationKeys()`
`boolean` | `isOneOff()` If this method returns true, then handler is invoked only once and then is removed from the bus.
`static
`<E,P extends Comparable<P>,C,K,H extends EventBus.Handle<E,P,C>,S extends EventStore<E,P,C,H,S>> EventHandlerWrapper<E,P,C,K,H,S>`
` | `peel(EventHandlerWrapper<E,P,C,K,H,S> handler)`
`void` | `post(EventDispatchContext<E,P,C,H,S> context, InferenceContext<E,P,C,K,H,S> inferenceContext, AbstractEventBus.Handle<E,P,C,K>... events)` Posts event for handling.
`void` | `reset()` Resets handler internal state, if any.
`void` | `takeSnapshot(AbstractEventBus.Snapshot<E,P,C,K,H,S> snapshot, Set<K> taken)`

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

Constructor Detail

### EventHandlerWrapperFilter

    public EventHandlerWrapperFilter(EventHandlerWrapper<E,P,C,K,H,S> master,
                                      predicate)

Method Detail

### 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.

### post

    public void post(EventDispatchContext<E,P,C,H,S> context,
                     InferenceContext<E,P,C,K,H,S> inferenceContext,
                     AbstractEventBus.Handle<E,P,C,K>... events)

  Description copied from interface: `EventHandlerWrapper`
  Posts event for handling.

  Specified by:
    `post` in interface `EventHandlerWrapper<E,P extends Comparable<P>,C,K,H extends EventBus.Handle<E,P,C>,S extends EventStore<E,P,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.

### 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.

### getRegistrationKeys

    public Set<K> getRegistrationKeys()

  Specified by:
    `getRegistrationKeys` in interface `EventHandlerWrapper<E,P extends Comparable<P>,C,K,H extends EventBus.Handle<E,P,C>,S extends EventStore<E,P,C,H,S>>`
  Returns:
    set of registration keys. Shared join event handler can have more than one registration key. When the set becomes empty the handler shall be removed from the inference network. Join event handlers shall cascade remove(K) to target handlers.

### getHandler

    public EventHandler<E,P,C,H,S> getHandler()

  Specified by:
    `getHandler` in interface `EventHandlerWrapper<E,P extends Comparable<P>,C,K,H extends EventBus.Handle<E,P,C>,S extends EventStore<E,P,C,H,S>>`

### takeSnapshot

    public void takeSnapshot(AbstractEventBus.Snapshot<E,P,C,K,H,S> snapshot,
                             Set<K> taken)

  Specified by:
    `takeSnapshot` in interface `EventHandlerWrapper<E,P extends Comparable<P>,C,K,H extends EventBus.Handle<E,P,C>,S extends EventStore<E,P,C,H,S>>`

### getPredicate

    public  getPredicate()

  Description copied from interface: `EventHandlerWrapper`
  Predicate which was used during registration.

  Specified by:
    `getPredicate` in interface `EventHandlerBase<E,P extends Comparable<P>,C>`
  Specified by:
    `getPredicate` in interface `EventHandlerWrapper<E,P extends Comparable<P>,C,K,H extends EventBus.Handle<E,P,C>,S extends EventStore<E,P,C,H,S>>`
  Returns:
    Handler predicates.

### getMaster

    public EventHandlerWrapper<E,P,C,K,H,S> getMaster()

### peel

    public static <E,P extends Comparable<P>,C,K,H extends EventBus.Handle<E,P,C>,S extends EventStore<E,P,C,H,S>> EventHandlerWrapper<E,P,C,K,H,S> peel(EventHandlerWrapper<E,P,C,K,H,S> handler)

### 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:

### 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:

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