i3.dragos.core.services.rules
Class Rule

java.lang.Object
  extended by i3.dragos.core.services.rules.Rule

public class Rule
extends java.lang.Object

Rules specify actions that are executed whenever a certain pattern is matched. Their main application is automated graph rewriting.

For much more information about RuleEngine and associated classes, please refer to the "Guide to Events and Rules" in the documentation.

Author:
Boris Boehlen <boehlen@cs.rwth-aachen.de>, Thorsten Hermes <thermes@i3.informatik.rwth-aachen.de>

Field Summary
protected  EventFilter pattern
          The pattern an event must match so that the rule is executed.
 
Constructor Summary
Rule(java.lang.String name, RuleAction action, EventFilter pattern)
          Creates a new rule.
 
Method Summary
 RuleAction getAction()
          Returns the action of the rule.
 java.lang.String getName()
          Returns the name of the rule.
 EventFilter getPattern()
          Returns the event pattern of the rule.
 boolean isEnabled()
          Returns true if the rule is enabled and false otherwise.
 void setEnabled(boolean enabled)
          Enables or disables the rule.
 java.lang.String toString()
          Returns a stringified representation of the rule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pattern

protected final EventFilter pattern
The pattern an event must match so that the rule is executed.

Constructor Detail

Rule

public Rule(java.lang.String name,
            RuleAction action,
            EventFilter pattern)
Creates a new rule.

Parameters:
name - The rule's name.
action - The action that is activated when the rule is triggered.
pattern - The event pattern which activates the rule.
Method Detail

getName

public java.lang.String getName()
Returns the name of the rule.

Returns:
The name.

getPattern

public EventFilter getPattern()
Returns the event pattern of the rule.

Returns:
The event pattern.

getAction

public RuleAction getAction()
Returns the action of the rule.

Returns:
The action.

setEnabled

public void setEnabled(boolean enabled)
Enables or disables the rule.

Parameters:
enabled - Determines whether the rule is enabled or not.

isEnabled

public boolean isEnabled()
Returns true if the rule is enabled and false otherwise.

Returns:
true if the rule is enabled, false otherwise.

toString

public java.lang.String toString()
Returns a stringified representation of the rule.

Overrides:
toString in class java.lang.Object
Returns:
A stringified representation.


Copyright © 2002-2008 RWTH Aachen, Department of Computer Science 3 (Software Engineering). All Rights Reserved.