org.jgroups.demos
Class CausalDemo

java.lang.Object
  extended by org.jgroups.demos.CausalDemo
All Implemented Interfaces:
java.lang.Runnable

public class CausalDemo
extends java.lang.Object
implements java.lang.Runnable

Simple causal demo where each member bcast a consecutive letter from the alphabet and picks the next member to transmit the next letter. Start a few instances of CausalDemo and pass a paramter "-start" to a CausalDemo that initiates transmission of a letter A. All participanting members should have correct alphabet. DISCARD layer has been added to simulate lost messages, thus forcing delaying of delivery of a certain alphabet letter until the causally prior one has been received. Remove CAUSAL from the stack and witness how FIFO alone doesn't provide this guarantee.

Author:
Vladimir Blagojevic

Constructor Summary
CausalDemo(boolean start)
           
 
Method Summary
 java.lang.String getNext(java.lang.String c)
           
 void listAlphabet()
           
static void main(java.lang.String[] args)
           
 void run()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CausalDemo

public CausalDemo(boolean start)
Method Detail

getNext

public java.lang.String getNext(java.lang.String c)

listAlphabet

public void listAlphabet()

run

public void run()
Specified by:
run in interface java.lang.Runnable

main

public static void main(java.lang.String[] args)


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