org.jgroups.protocols.rules
Class SampleRule

java.lang.Object
  extended by org.jgroups.protocols.rules.Rule
      extended by org.jgroups.protocols.rules.SampleRule
All Implemented Interfaces:
java.lang.Runnable

public class SampleRule
extends Rule

Since:
3.3
Author:
Bela Ban

Field Summary
 
Fields inherited from class org.jgroups.protocols.rules.Rule
log, sv
 
Constructor Summary
SampleRule()
           
 
Method Summary
 java.lang.String condition()
          Returns a description of the condition that led to Rule.eval() returning true
 java.lang.String description()
          Describes what the rules does
 boolean eval()
          Evaluates the condition.
 java.lang.String name()
          Returns the name of the rule.
 void trigger()
          The action of the rule.
 
Methods inherited from class org.jgroups.protocols.rules.Rule
destroy, init, log, run, supervisor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SampleRule

public SampleRule()
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

Specified by:
name in class Rule

description

public java.lang.String description()
Description copied from class: Rule
Describes what the rules does

Specified by:
description in class Rule

eval

public boolean eval()
Description copied from class: Rule
Evaluates the condition. If true, the rule is triggered. If true, the next execution of Rule.condition() should return a non-null string

Specified by:
eval in class Rule

condition

public java.lang.String condition()
Description copied from class: Rule
Returns a description of the condition that led to Rule.eval() returning true

Specified by:
condition in class Rule

trigger

public void trigger()
             throws java.lang.Throwable
Description copied from class: Rule
The action of the rule. Triggered if Rule.eval() returned true

Specified by:
trigger in class Rule
Throws:
java.lang.Throwable


Copyright © 1998-2012 Bela Ban / Red Hat. All Rights Reserved.