QJCC homepage

biz.chitec.quarterback.gjsa
Class BurstReceiverHandler

java.lang.Object
  extended byjava.lang.Thread
      extended bybiz.chitec.quarterback.gjsa.BurstReceiverHandler
All Implemented Interfaces:
java.lang.Runnable

public class BurstReceiverHandler
extends java.lang.Thread

client side asynchronous burst handler. Used in conjunction with SessionConnector. BurstReceiverHandler handles asynchronous bursts in a separate thread. It passes incoming burst parts to a BurstReceiver. BurstReceiverHandler can manage multiple asynchronous bursts at the same time though this is not supported by the server (and probably never will be).

As asynchronous burst parts may be received before a handler is installed for the burst, BurstReceiverHandler buffers these burst parts for a certain time (20 seconds by default). On the other hand, a BurstReceiver is removed after 20 seconds of idling (e.g. no burst parts have been received for this BurstReceiver). Deletion is of course forced if a BURSTEND/STOPPED/ERROR is received for this BurstReceiver.

The aynchronous communication system in the GJSA needs a complete conceptual overhaul.

Version:
$Id: 6b0948a3a2f16e87b17428518f9ce0bf3bf22d05 $
Author:
Dirk Hillbrecht 1997-1999, chitec/Dirk Hillbrecht 2000. Distributed under the terms of the GNU LGPL.

Field Summary
static int ALIVEMILLIS
          idle time a BurstReceiver of parts of a burst are stored before deletion
(package private)  java.util.Map handlers
           
(package private)  int receivednum
           
(package private)  ThreadInterface ti
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
BurstReceiverHandler()
          public constructor.
 
Method Summary
 ThreadInterface getProducerInterface()
          returns the interface burst parts must be send to.
 void run()
          run loop.
 void setBurstReceiver(int bnum, BurstReceiver br)
          sets a burst receiver for an asynchronous burst.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ALIVEMILLIS

public static int ALIVEMILLIS
idle time a BurstReceiver of parts of a burst are stored before deletion


ti

ThreadInterface ti

handlers

java.util.Map handlers

receivednum

int receivednum
Constructor Detail

BurstReceiverHandler

public BurstReceiverHandler()
public constructor. Starts the BurstReceiverHandler thread.

Method Detail

getProducerInterface

public ThreadInterface getProducerInterface()
returns the interface burst parts must be send to.


setBurstReceiver

public void setBurstReceiver(int bnum,
                             BurstReceiver br)
sets a burst receiver for an asynchronous burst. For each burst, a BurstReceiver can only be set once.


run

public void run()
run loop. Stops only on IOException at the ThreadInterface.


QJCC homepage