org.jgroups.stack
Class Retransmitter

java.lang.Object
  extended by org.jgroups.stack.Retransmitter
Direct Known Subclasses:
DefaultRetransmitter, RangeBasedRetransmitter

public abstract class Retransmitter
extends java.lang.Object

Abstract class of a retransmitter. Maintains a pool of sequence numbers of messages that need to be retransmitted. Messages are aged and retransmission requests sent according to age (configurable backoff). If a TimeScheduler instance is given to the constructor, it will be used, otherwise Reransmitter will create its own. The retransmit timeouts have to be set first thing after creating an instance. The add() method adds the sequence numbers of messages to be retransmitted. The remove() method removes a sequence number again, cancelling retransmission requests for it. Whenever a message needs to be retransmitted, the RetransmitCommand.retransmit() method is called. It can be used e.g. by an ack-based scheme (e.g. AckSenderWindow) to retransmit a message to the receiver, or by a nak-based scheme to send a retransmission request to the sender of the missing message.

Author:
Bela Ban

Nested Class Summary
static interface Retransmitter.RetransmitCommand
          Retransmit command (see Gamma et al.) used to retrieve missing messages
protected  class Retransmitter.Task
           
 
Field Summary
protected  Retransmitter.RetransmitCommand cmd
           
protected static Log log
           
protected  Interval retransmit_timeouts
          Default retransmit intervals (ms) - exponential approx.
protected  Address sender
           
protected  TimeScheduler timer
           
protected  long xmit_stagger_timeout
           
 
Constructor Summary
Retransmitter(Address sender, Retransmitter.RetransmitCommand cmd, TimeScheduler sched)
          Create a new Retransmitter associated with the given sender address
 
Method Summary
abstract  void add(long first_seqno, long last_seqno)
          Add messages from first_seqno to last_seqno for retransmission
 long getXmitStaggerTimeout()
           
abstract  void remove(long seqno)
          Remove the given sequence number from retransmission
abstract  void reset()
          Reset the retransmitter: clear all msgs and cancel all the respective tasks
 void setRetransmitTimeouts(Interval interval)
           
 void setXmitStaggerTimeout(long xmit_stagger_timeout)
           
abstract  int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

retransmit_timeouts

protected Interval retransmit_timeouts
Default retransmit intervals (ms) - exponential approx.


sender

protected final Address sender

cmd

protected final Retransmitter.RetransmitCommand cmd

timer

protected final TimeScheduler timer

xmit_stagger_timeout

protected long xmit_stagger_timeout

log

protected static final Log log
Constructor Detail

Retransmitter

public Retransmitter(Address sender,
                     Retransmitter.RetransmitCommand cmd,
                     TimeScheduler sched)
Create a new Retransmitter associated with the given sender address

Parameters:
sender - the address from which retransmissions are expected or to which retransmissions are sent
cmd - the retransmission callback reference
sched - retransmissions scheduler
Method Detail

setRetransmitTimeouts

public void setRetransmitTimeouts(Interval interval)

getXmitStaggerTimeout

public long getXmitStaggerTimeout()

setXmitStaggerTimeout

public void setXmitStaggerTimeout(long xmit_stagger_timeout)

add

public abstract void add(long first_seqno,
                         long last_seqno)
Add messages from first_seqno to last_seqno for retransmission


remove

public abstract void remove(long seqno)
Remove the given sequence number from retransmission


reset

public abstract void reset()
Reset the retransmitter: clear all msgs and cancel all the respective tasks


size

public abstract int size()


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