Package jadex.platform.service.ecarules
Class RuleAgent
- java.lang.Object
-
- jadex.platform.service.ecarules.RulebaseAgent
-
- jadex.platform.service.ecarules.RuleAgent
-
- All Implemented Interfaces:
IRulebaseService
,IRuleEngineService
,IRuleService
public class RuleAgent extends RulebaseAgent implements IRuleService
Agent that exposes an eca rule engine as service. Allows for adding/removing rules and getting events.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<SubscriptionIntermediateFuture<RuleEvent>>
resubscribers
The subscriptions.protected RuleSystem
rulesystem
The rule engine.-
Fields inherited from class jadex.platform.service.ecarules.RulebaseAgent
agent, callfutures, opencalls, rbsubscribers, rulebase
-
-
Constructor Summary
Constructors Constructor Description RuleAgent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IIntermediateFuture<RuleEvent>
addEvent(IEvent event)
Add an external event to the rule engine.IRulebase
getRulebase()
Get the rulebase.IFuture<java.lang.Void>
init()
Init method.protected void
publishEvent(RuleEvent event)
ISubscriptionIntermediateFuture<RuleEvent>
subscribeToEngine()
Subscribe to rule executions.-
Methods inherited from class jadex.platform.service.ecarules.RulebaseAgent
addRule, notifyCurrentState, notifySubscribers, removeRule, subscribeToRulebase
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jadex.bridge.service.types.ecarules.IRulebaseService
addRule, removeRule, subscribeToRulebase
-
-
-
-
Field Detail
-
rulesystem
protected RuleSystem rulesystem
The rule engine.
-
resubscribers
protected java.util.List<SubscriptionIntermediateFuture<RuleEvent>> resubscribers
The subscriptions.
-
-
Method Detail
-
init
public IFuture<java.lang.Void> init()
Init method.
-
getRulebase
public IRulebase getRulebase()
Get the rulebase.- Overrides:
getRulebase
in classRulebaseAgent
-
addEvent
public IIntermediateFuture<RuleEvent> addEvent(IEvent event)
Add an external event to the rule engine. It will process the event and fire rules accordingly.- Specified by:
addEvent
in interfaceIRuleEngineService
- Parameters:
event
- The event.
-
subscribeToEngine
public ISubscriptionIntermediateFuture<RuleEvent> subscribeToEngine()
Subscribe to rule executions.- Specified by:
subscribeToEngine
in interfaceIRuleEngineService
-
publishEvent
protected void publishEvent(RuleEvent event)
-
-