|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.hammurapi.eventbus.PredicateChainingMatcher<E,P,C,K,H,S>
public abstract class PredicateChainingMatcher<E,P extends Comparable<P>,C,K,H extends EventBus.Handle<E,P,C>,S extends EventStore<E,P,C,H,S>>
| Nested Class Summary | |
|---|---|
protected class |
PredicateChainingMatcher.EventBusJoiner
|
protected class |
PredicateChainingMatcher.JoinInput
|
protected class |
PredicateChainingMatcher.JoinInputEventHandler
|
protected class |
PredicateChainingMatcher.JoinNode
Joins several inputs, applies predicate(s) |
| Nested classes/interfaces inherited from interface com.hammurapi.eventbus.Matcher |
|---|
Matcher.HandlerManager<E,P extends Comparable<P>,C,K,H extends EventBus.Handle<E,P,C>,S extends EventStore<E,P,C,H,S>> |
| Field Summary | |
|---|---|
protected PredicatedInferenceNode<E,P,C,K,H,S> |
rootNode
Root inference node with True predicate. |
| Constructor Summary | |
|---|---|
PredicateChainingMatcher()
|
|
| Method Summary | |
|---|---|
K |
addHandler(EventHandler<E,P,C,H,S> eventHandler)
Adds handler to the matcher. |
protected abstract TrackingExecutorService |
createExecutorService(ExecutorService master,
boolean oneOff,
String name)
Creates a wrapper around the master executor service for task tracking purposes. |
protected abstract PredicateChainingMatcher.EventBusJoiner |
createJoiner(JoinEventHandler<E,P,C,K,H,S> handler,
int[][] indices)
|
protected abstract PredicatedInferenceNode<E,P,C,K,H,S> |
createPredicatedInferenceNode(PredicatedInferenceNode<E,P,C,K,H,S> parent,
|
protected abstract Set<K> |
extractHandlerIds(EventHandlerWrapper<E,P,C,K,H,S> handler)
|
EventBus<E,P,C,K,H,S> |
getEventBus()
|
protected abstract ReadWriteLock |
getLock()
Lock for the inference network. |
void |
manageHandlers(Matcher.HandlerManager<E,P,C,K,H,S> handlerManager)
This method is used for batch live updates of matcher handlers. |
Iterable<EventHandlerWrapper<E,P,C,K,H,S>> |
match(E event,
ExecutorService executorService)
|
protected abstract K |
nextId()
Generates handler ID. |
void |
removeHandlers(Iterable<K> keys)
|
void |
reset()
Resets handler's state. |
void |
setEventBus(EventBus<E,P,C,K,H,S> bus)
This method is invoked by the bus to provide a reference to self. |
void |
takeSnapshot(AbstractEventBus.Snapshot<E,P,C,K,H,S> snapshot)
Takes matcher snapshot. |
protected abstract EventHandlerWrapper<E,P,C,K,H,S> |
wrap(EventHandler<E,P,C,H,S> eventHandler,
K registrationKey)
Factory method for handler wrapper. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected PredicatedInferenceNode<E,P extends Comparable<P>,C,K,H extends EventBus.Handle<E,P,C>,S extends EventStore<E,P,C,H,S>> rootNode
| Constructor Detail |
|---|
public PredicateChainingMatcher()
| Method Detail |
|---|
protected abstract TrackingExecutorService createExecutorService(ExecutorService master,
boolean oneOff,
String name)
master - Master executor service
public Iterable<EventHandlerWrapper<E,P,C,K,H,S>> match(E event,
ExecutorService executorService)
match in interface Matcher<E,P extends Comparable<P>,C,K,H extends EventBus.Handle<E,P,C>,S extends EventStore<E,P,C,H,S>>executorService - Executor service to use for parallel matching.
public K addHandler(EventHandler<E,P,C,H,S> eventHandler)
Matcher
addHandler in interface Matcher<E,P extends Comparable<P>,C,K,H extends EventBus.Handle<E,P,C>,S extends EventStore<E,P,C,H,S>>protected abstract ReadWriteLock getLock()
public void takeSnapshot(AbstractEventBus.Snapshot<E,P,C,K,H,S> snapshot)
Matcher
takeSnapshot in interface Matcher<E,P extends Comparable<P>,C,K,H extends EventBus.Handle<E,P,C>,S extends EventStore<E,P,C,H,S>>public void removeHandlers(Iterable<K> keys)
removeHandlers in interface Matcher<E,P extends Comparable<P>,C,K,H extends EventBus.Handle<E,P,C>,S extends EventStore<E,P,C,H,S>>public void reset()
Matcher
reset in interface Matcher<E,P extends Comparable<P>,C,K,H extends EventBus.Handle<E,P,C>,S extends EventStore<E,P,C,H,S>>public void manageHandlers(Matcher.HandlerManager<E,P,C,K,H,S> handlerManager)
Matcher
manageHandlers in interface Matcher<E,P extends Comparable<P>,C,K,H extends EventBus.Handle<E,P,C>,S extends EventStore<E,P,C,H,S>>
protected abstract PredicatedInferenceNode<E,P,C,K,H,S> createPredicatedInferenceNode(PredicatedInferenceNode<E,P,C,K,H,S> parent,
predicate,
C context)
protected abstract Set<K> extractHandlerIds(EventHandlerWrapper<E,P,C,K,H,S> handler)
protected abstract K nextId()
protected abstract EventHandlerWrapper<E,P,C,K,H,S> wrap(EventHandler<E,P,C,H,S> eventHandler,
K registrationKey)
eventHandler - oneOff -
protected abstract PredicateChainingMatcher.EventBusJoiner createJoiner(JoinEventHandler<E,P,C,K,H,S> handler,
int[][] indices)
public void setEventBus(EventBus<E,P,C,K,H,S> bus)
Matcher
setEventBus in interface Matcher<E,P extends Comparable<P>,C,K,H extends EventBus.Handle<E,P,C>,S extends EventStore<E,P,C,H,S>>public EventBus<E,P,C,K,H,S> getEventBus()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||