disciplex.eventfilter
Class DistributionAgent
java.lang.Object
|
+--disciple.core.DataDistributionAgent
|
+--disciplex.eventfilter.DistributionAgent
- public class DistributionAgent
- extends DataDistributionAgent
The main task for the DataDistributionAgent is to filter the incoming events.
The filtering is based on client subscriptions.
Currently the disciple subscription language follows the
JEOPS language, e.g.
import disciple.agents.*;
ruleBase BaseFact{
rule Rule1 {
declarations
Fact f;
localdecl
String msg = f.evaluateElementName("flatscape/time/overlay");
conditions
"overlay".equals(msg);
actions
f.setPriority("H");
System.out.println("Message: (ElementName)");
}
rule Rule2 {
declarations
Fact f;
localdecl
String msg = f.evaluateTextNode("affiliation/text()");
conditions
( "F".equals(msg) || "H".equals(msg));
actions
f.setPriority("H");
System.out.println("Message: (ElementName) : " + msg);
}
}
Copyright (c) 2002 Rutgers, The State University of New Jersey
- Since:
- Disciple v3.0
- Version:
- $Revision: 1.1.1.1 $
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DistributionAgent
public DistributionAgent()
DistributionAgent
public DistributionAgent(Repository repos)
setRules
public void setRules(java.lang.Object clientID,
java.lang.Object rules)
- Inserts client subscriptions into the rule base.
- Specified by:
setRules in class DataDistributionAgent
- Parameters:
clientID - - The clients Id.rules - - The rules to be inserted. Must be a String.
applyRules
public PrioritizedConnectionList applyRules(Command cmd)
- Applies the rules to a given command (Fact).
- Specified by:
applyRules in class DataDistributionAgent
- Parameters:
cmd - - The received command, which is to be checked in the rule base.
- Returns:
- a prioritized list (PrioritizedConnectionList)
removeSubscription
public boolean removeSubscription(java.lang.Object clientID)
- Removes a subscription from the subscription list.
- Parameters:
clientID - - The client whose subscription should be removed.
- Returns:
- true if the subscription was removed.
Copyright (c) 2003 Rutgers, The State University of New Jersey