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

Quick Search    Search Deep

org.jgroups.protocols
Class FRAG.FragmentationTable  view FRAG.FragmentationTable download FRAG.FragmentationTable.java

java.lang.Object
  extended byorg.jgroups.protocols.FRAG.FragmentationTable
Enclosing class:
FRAG

static class FRAG.FragmentationTable
extends java.lang.Object

Keeps track of the fragments that are received. Reassembles fragements into entire messages when all fragments have been received. The fragmentation holds a an array of byte arrays for a unique sender The first dimension of the array is the order of the fragmentation, in case the arrive out of order


Nested Class Summary
(package private) static class FRAG.FragmentationTable.Entry
          inner class represents an entry for a message each entry holds an array of byte arrays sorted once all the byte buffer entries have been filled the fragmentation is considered complete.
 
Field Summary
private  java.util.Hashtable h
           
private  org.jgroups.Address sender
           
 
Constructor Summary
(package private) FRAG.FragmentationTable(org.jgroups.Address sender)
           
 
Method Summary
 byte[] add(long id, int frag_id, int tot_frags, byte[] fragment)
          Creates a new entry if not yet present.
 void reset()
           
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sender

private final org.jgroups.Address sender

h

private final java.util.Hashtable h
Constructor Detail

FRAG.FragmentationTable

FRAG.FragmentationTable(org.jgroups.Address sender)
Method Detail

add

public byte[] add(long id,
                  int frag_id,
                  int tot_frags,
                  byte[] fragment)
Creates a new entry if not yet present. Adds the fragment. If all fragements for a given message have been received, an entire message is reassembled and returned. Otherwise null is returned.


reset

public void reset()

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).