Package jadex.platform.service.ecarules
Class RulebaseAgent
- java.lang.Object
- 
- jadex.platform.service.ecarules.RulebaseAgent
 
- 
- All Implemented Interfaces:
- IRulebaseService
 - Direct Known Subclasses:
- RuleAgent
 
 public class RulebaseAgent extends java.lang.Object implements IRulebaseService Agent that encapsulates a rulebase and allows for tracking changes of it. Can be used to distribute rules among different rule engine agents that listen on the changes of the rulebase and do add/remove the same rules locally.
- 
- 
Field SummaryFields Modifier and Type Field Description protected IInternalAccessagentThe agent.protected java.util.Map<java.lang.Integer,Future<java.lang.Void>>callfuturescallid -> future .protected java.util.Map<java.lang.Integer,java.util.Set<java.lang.Integer>>opencallsThe open calls (callid -> set of event ids that have to be acked.protected java.util.List<SubscriptionIntermediateFuture<IRulebaseEvent>>rbsubscribersThe subscriptions.protected IRulebaserulebaseThe rulebase.
 - 
Constructor SummaryConstructors Constructor Description RulebaseAgent()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description IFuture<java.lang.Void>addRule(IRule<?> rule)Add a new rule.IRulebasegetRulebase()Get the rulebase.protected voidnotifyCurrentState(SubscriptionIntermediateFuture<IRulebaseEvent> sub)Notify the current state.protected IFuture<java.lang.Void>notifySubscribers(ARulebaseEvent event, java.util.Set<java.lang.Integer> evs)Notify all subscribers of an event.IFuture<java.lang.Void>removeRule(java.lang.String rulename)Remove a rule.ISubscriptionIntermediateFuture<IRulebaseEvent>subscribeToRulebase()Subscribe to rule base changes.
 
- 
- 
- 
Field Detail- 
agentprotected IInternalAccess agent The agent.
 - 
rbsubscribersprotected java.util.List<SubscriptionIntermediateFuture<IRulebaseEvent>> rbsubscribers The subscriptions.
 - 
rulebaseprotected IRulebase rulebase The rulebase.
 - 
opencallsprotected java.util.Map<java.lang.Integer,java.util.Set<java.lang.Integer>> opencalls The open calls (callid -> set of event ids that have to be acked.
 - 
callfuturesprotected java.util.Map<java.lang.Integer,Future<java.lang.Void>> callfutures callid -> future .
 
- 
 - 
Method Detail- 
getRulebasepublic IRulebase getRulebase() Get the rulebase.
 - 
addRulepublic IFuture<java.lang.Void> addRule(IRule<?> rule) Add a new rule.- Specified by:
- addRulein interface- IRulebaseService
- Parameters:
- rule- The rule.
 
 - 
removeRulepublic IFuture<java.lang.Void> removeRule(java.lang.String rulename) Remove a rule.- Specified by:
- removeRulein interface- IRulebaseService
- Parameters:
- rule- The rule.
 
 - 
subscribeToRulebasepublic ISubscriptionIntermediateFuture<IRulebaseEvent> subscribeToRulebase() Subscribe to rule base changes.- Specified by:
- subscribeToRulebasein interface- IRulebaseService
 
 - 
notifySubscribersprotected IFuture<java.lang.Void> notifySubscribers(ARulebaseEvent event, java.util.Set<java.lang.Integer> evs) Notify all subscribers of an event.
 - 
notifyCurrentStateprotected void notifyCurrentState(SubscriptionIntermediateFuture<IRulebaseEvent> sub) Notify the current state.
 
- 
 
-