Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.jgroups.protocols
Class MessageAcks  view MessageAcks download MessageAcks.java

java.lang.Object
  extended byorg.jgroups.protocols.MessageAcks

class MessageAcks
extends java.lang.Object

class MessageAcks

Used by sequencer to store cumulative acknowledgements of broadcast messages sent to the group in this view


Nested Class Summary
(package private)  class MessageAcks.Entry
          class Entry (inner class)

object type to store cumulative acknowledgements using a member's Address and the sequence id of a message

 
Field Summary
private  java.util.Vector acks
           
(package private)  org.apache.commons.logging.Log log
           
private  SavedMessages message_history
           
 
Constructor Summary
(package private) MessageAcks(java.util.Vector members)
          Constructor - creates a Vector of "Entry"s given a Vector of "Address"es for the members
 
Method Summary
 void addMessage(org.jgroups.Message msg, long seq)
          adds the given message (with the specified sequence id) to the message history if the given sequence id already exists in the message history, the message is NOT added
private  void clear()
          clear all acknowledgements and the message history
private  MessageAcks.Entry getEntry(org.jgroups.Address addr)
          returns the Entry from the acknowledgement Vector with the given Address returns null if an Entry with the given Address is not found
private  long getLowestSeqAck()
          returns the minimum cumulative acknowledged sequence id from all the members (i.e.
 org.jgroups.Message getMessage(long seq)
          returns the message in the history that matches the given sequence id returns null if no message exists in the history with this sequence id
 long getSeq(org.jgroups.Address addr)
          returns the sequence id of the "latest" cumulative acknowledgement for the specified Address if the Address is not found in the member list, a negative value is returned note: the value returned may also be negative if their have been no acknowledgements from the given address
 void reset(java.util.Vector members)
          resets acknowledgement Vector with "Entry"s using the given Vector of "Address"es also clears the message history
 void setSeq(org.jgroups.Address addr, long seq)
          sets the sequence id for the given Address to the given value note: if the current sequence value for this host is greater than the given value, the sequence for this member is NOT changed (i.e.
private  void truncateHistory()
          removes messages from the history that have been acknowledged by all the members of the group
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

final org.apache.commons.logging.Log log

acks

private final java.util.Vector acks

message_history

private final SavedMessages message_history
Constructor Detail

MessageAcks

MessageAcks(java.util.Vector members)
Constructor - creates a Vector of "Entry"s given a Vector of "Address"es for the members

Method Detail

reset

public void reset(java.util.Vector members)
resets acknowledgement Vector with "Entry"s using the given Vector of "Address"es also clears the message history


clear

private void clear()
clear all acknowledgements and the message history


getEntry

private MessageAcks.Entry getEntry(org.jgroups.Address addr)
returns the Entry from the acknowledgement Vector with the given Address returns null if an Entry with the given Address is not found


setSeq

public void setSeq(org.jgroups.Address addr,
                   long seq)
sets the sequence id for the given Address to the given value note: if the current sequence value for this host is greater than the given value, the sequence for this member is NOT changed (i.e. it will only set it to a larger value) if the given Address is not found in the member list, nothing is changed


getSeq

public long getSeq(org.jgroups.Address addr)
returns the sequence id of the "latest" cumulative acknowledgement for the specified Address if the Address is not found in the member list, a negative value is returned note: the value returned may also be negative if their have been no acknowledgements from the given address


getMessage

public org.jgroups.Message getMessage(long seq)
returns the message in the history that matches the given sequence id returns null if no message exists in the history with this sequence id


addMessage

public void addMessage(org.jgroups.Message msg,
                       long seq)
adds the given message (with the specified sequence id) to the message history if the given sequence id already exists in the message history, the message is NOT added


getLowestSeqAck

private long getLowestSeqAck()
returns the minimum cumulative acknowledged sequence id from all the members (i.e. the greatest sequence id cumulatively acknowledged by all members)


truncateHistory

private void truncateHistory()
removes messages from the history that have been acknowledged by all the members of the group