|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object i3.dragos.core.AbstractService i3.dragos.core.services.rules.RuleEngine
public final class RuleEngine
The RuleEngine
service
is responsible for
managing rules and executing them when an event is triggered.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface i3.dragos.core.Service |
---|
Service.Result, Service.State |
Constructor Summary | |
---|---|
RuleEngine()
Constructs a new rule engine. |
Method Summary | |
---|---|
void |
addRule(Rule rule,
RuleCouplingMode mode,
DataSourceURL ds)
Registers a Rule. |
static RuleEngine |
getInstance()
Returns the rule engine registered by the service manager. |
java.lang.String |
getName()
Returns the name of the service. |
Service.Result |
initialize()
Initializes the services. |
void |
removeRule(Rule rule,
RuleCouplingMode mode,
DataSourceURL ds)
Unregisters a Rule. |
Service.Result |
uninitialize()
Uninitializes the services and releases all resources used by the service. |
Methods inherited from class i3.dragos.core.AbstractService |
---|
getState, resume, start, stop, suspend |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RuleEngine()
Method Detail |
---|
public static RuleEngine getInstance()
public java.lang.String getName()
public Service.Result initialize()
initialize
in interface Service
initialize
in class AbstractService
public Service.Result uninitialize()
uninitialize
in interface Service
uninitialize
in class AbstractService
public void addRule(Rule rule, RuleCouplingMode mode, DataSourceURL ds)
null
indicates that the rule's
trigger condition will be verified for all events.
A Rule can register multiple times, which means that he will receive each event more than once. A
separate list of rules is maintained for each category, where category means a specific
RuleCouplingMode/DataSourceURL pair (where the DataSourceURL may be null
). When unregistering,
you have to specify the same parameter values you used when registering, otherwise RuleEngine will look in the
wrong category and not find the correct rule entry (or none at all).
rule
- The DataListener (must not be null
).mode
- The RuleCouplingMode (must not be null
).ds
- The DataSourceURL (may be null
).public void removeRule(Rule rule, RuleCouplingMode mode, DataSourceURL ds)
rule
- The DataListener (must not be null
).mode
- The RuleCouplingMode (must not be null
).ds
- The DataSourceURL (may be null
).addRule(Rule, RuleCouplingMode, DataSourceURL)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |