jbora
Class WhiteBoard

java.lang.Object
  extended byjbora.WhiteBoard

public class WhiteBoard
extends Object

A table of integers with one element corresponding to each group member. Consists of pairs (ProcessID, int).

Each whiteboard instance is a table of integers, with one element corresponding to each member.
The call JBora.whiteBoardUpdate(value) sets the element of the table corresponding to the invoking member to val. The call JBora.whiteBoardRead(proc) returns the value of the table element associated with group member p (p must be in the same view as the invoking process).

Updates to the whiteboard need not trigger additional multicasts. The current whiteboard value is automatically piggybacked into messages that the GC-layer has to exchange anyway. If no messages are exchanged by the GC-layer, whiteboard information is multicast at the predefined intervals. (See JBora constructor.)

Whiteboard mechanism was designed as an aid in implementing load-balancing policies since it allows the quick and efficient propagation of load indexes among servers.

Author:
Milan Prica

Constructor Summary
WhiteBoard()
          Creates a new whiteboard object.
 
Method Summary
 Integer getValue(ProcessID proc)
          Gets the value associated with a ProcessID.
 void putValue(ProcessID proc, int value)
          Inserts a value (if the value is negative, then it inserts 0).
 int size()
          Returns the number of elements in the whiteboard.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WhiteBoard

public WhiteBoard()
Creates a new whiteboard object.

Method Detail

getValue

public Integer getValue(ProcessID proc)
                 throws JBoraException
Gets the value associated with a ProcessID.

Parameters:
proc -
Returns:
Value associated with proc
Throws:
WhiteboardException - proc is null or proc is not in the whiteboard
JBoraException

putValue

public void putValue(ProcessID proc,
                     int value)
              throws JBoraException
Inserts a value (if the value is negative, then it inserts 0).

Parameters:
proc - Key
value - Value
Throws:
WhiteboardException - proc is null or proc is not in the whiteboard
JBoraException

size

public int size()
Returns the number of elements in the whiteboard.

Returns:
Number of elements