public class RuleEngine
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
RuleEngine(RuleBase ruleBase)
Creates a rule engine for the given ruleBase
|
Modifier and Type | Method and Description |
---|---|
<EventAtom> |
addRule(RuleSpecification<EventAtom> specification)
Adds a rule specification to the RuleBase.
|
<EventAtom> |
addRule(RuleSpecification<EventAtom> specification,
EventFilter<? super EventAtom> filter)
Adds a rule specification to the RuleBase with the given filter.
|
<EventAtom> |
containsRule(RuleSpecification<EventAtom> specification)
Decides whether a rule specification is already added to the RuleBase
without filter.
|
<EventAtom> |
containsRule(RuleSpecification<EventAtom> specification,
EventFilter<? super EventAtom> filter)
Decides whether a rule specification is already added to the RuleBase
with the specified filter.
|
static RuleEngine |
create(RuleBase ruleBase)
Creates a rule engine for the given ruleBase
|
ScopedConflictSet |
createScopedConflictSet(ConflictResolver conflictResolver,
com.google.common.collect.Multimap<RuleSpecification<?>,EventFilter<?>> specifications) |
ScopedConflictSet |
createScopedConflictSet(com.google.common.collect.Multimap<RuleSpecification<?>,EventFilter<?>> specifications) |
<EventAtom> |
createScopedConflictSet(RuleSpecification<EventAtom> specification,
EventFilter<? super EventAtom> eventFilter) |
void |
dispose()
Disposes of the rule base.
|
com.google.common.collect.Multimap<ActivationState,Activation<?>> |
getActivations() |
java.util.Set<Activation<?>> |
getActivations(ActivationState state) |
<EventAtom> |
getActivations(RuleSpecification<EventAtom> specification) |
<EventAtom> |
getActivations(RuleSpecification<EventAtom> specification,
ActivationState state) |
<EventAtom> |
getActivations(RuleSpecification<EventAtom> specification,
EventFilter<? super EventAtom> filter) |
<EventAtom> |
getActivations(RuleSpecification<EventAtom> specification,
EventFilter<? super EventAtom> filter,
ActivationState state) |
java.util.Set<Activation<?>> |
getConflictingActivations() |
EventRealm |
getEventRealm() |
org.apache.log4j.Logger |
getLogger() |
Activation<?> |
getNextActivation() |
protected RuleBase |
getRuleBase() |
com.google.common.collect.Multimap<RuleSpecification<?>,EventFilter<?>> |
getRuleSpecificationMultimap() |
<EventAtom> |
removeRule(RuleSpecification<EventAtom> specification)
Removes the given not-filtered rule from the EVM.
|
<EventAtom> |
removeRule(RuleSpecification<EventAtom> specification,
EventFilter<? super EventAtom> filter)
Removes the given filtered rule from the EVM.
|
void |
setConflictResolver(ConflictResolver conflictResolver) |
protected RuleEngine(RuleBase ruleBase)
ruleBase
- public static RuleEngine create(RuleBase ruleBase)
ruleBase
- public void setConflictResolver(ConflictResolver conflictResolver)
public <EventAtom> ScopedConflictSet createScopedConflictSet(RuleSpecification<EventAtom> specification, EventFilter<? super EventAtom> eventFilter)
public ScopedConflictSet createScopedConflictSet(com.google.common.collect.Multimap<RuleSpecification<?>,EventFilter<?>> specifications)
public ScopedConflictSet createScopedConflictSet(ConflictResolver conflictResolver, com.google.common.collect.Multimap<RuleSpecification<?>,EventFilter<?>> specifications)
public <EventAtom> boolean addRule(RuleSpecification<EventAtom> specification)
specification
- public <EventAtom> boolean addRule(RuleSpecification<EventAtom> specification, EventFilter<? super EventAtom> filter)
specification
- filter
- the partial match to be used as a filter for activationspublic <EventAtom> boolean containsRule(RuleSpecification<EventAtom> specification)
public <EventAtom> boolean containsRule(RuleSpecification<EventAtom> specification, EventFilter<? super EventAtom> filter)
public com.google.common.collect.Multimap<ActivationState,Activation<?>> getActivations()
public Activation<?> getNextActivation()
public java.util.Set<Activation<?>> getConflictingActivations()
public java.util.Set<Activation<?>> getActivations(ActivationState state)
state
- public <EventAtom> java.util.Set<Activation<EventAtom>> getActivations(RuleSpecification<EventAtom> specification)
specification
- public <EventAtom> java.util.Set<Activation<EventAtom>> getActivations(RuleSpecification<EventAtom> specification, EventFilter<? super EventAtom> filter)
specification
- filter
- public <EventAtom> java.util.Set<Activation<EventAtom>> getActivations(RuleSpecification<EventAtom> specification, ActivationState state)
specification
- state
- public <EventAtom> java.util.Set<Activation<EventAtom>> getActivations(RuleSpecification<EventAtom> specification, EventFilter<? super EventAtom> filter, ActivationState state)
specification
- filter
- state
- public com.google.common.collect.Multimap<RuleSpecification<?>,EventFilter<?>> getRuleSpecificationMultimap()
public <EventAtom> boolean removeRule(RuleSpecification<EventAtom> specification)
specification
- public <EventAtom> boolean removeRule(RuleSpecification<EventAtom> specification, EventFilter<? super EventAtom> filter)
specification
- filter
- the partial match used as a filterprotected RuleBase getRuleBase()
public EventRealm getEventRealm()
public org.apache.log4j.Logger getLogger()
public void dispose()