Package org.jgroups.protocols.rules
Class SampleRule
- java.lang.Object
-
- org.jgroups.protocols.rules.Rule
-
- org.jgroups.protocols.rules.SampleRule
-
- All Implemented Interfaces:
java.lang.Runnable
public class SampleRule extends Rule
- Since:
- 3.3
- Author:
- Bela Ban
-
-
Constructor Summary
Constructors Constructor Description SampleRule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
condition()
Returns a description of the condition that led toRule.eval()
returning truejava.lang.String
description()
Describes what the rules doesboolean
eval()
Evaluates the condition.java.lang.String
name()
Returns the name of the rule.void
trigger()
The action of the rule.
-
-
-
Method Detail
-
name
public java.lang.String name()
Description copied from class:Rule
Returns the name of the rule. Should be unique if a rule needs to be uninstalled
-
description
public java.lang.String description()
Description copied from class:Rule
Describes what the rules does- Specified by:
description
in classRule
-
eval
public boolean eval()
Description copied from class:Rule
Evaluates the condition. If true, the rule is triggered. If true, the next execution ofRule.condition()
should return a non-null string
-
condition
public java.lang.String condition()
Description copied from class:Rule
Returns a description of the condition that led toRule.eval()
returning true
-
trigger
public void trigger() throws java.lang.Throwable
Description copied from class:Rule
The action of the rule. Triggered ifRule.eval()
returned true
-
-