solar.test
Class GroundHog

java.lang.Object
  |
  +--solar.test.GroundHog
All Implemented Interfaces:
TransportListener

public class GroundHog
extends java.lang.Object
implements TransportListener

This class can be used to produce background network traffic.

Version:
$Id: GroundHog.java,v 1.2 2003/10/13 03:13:06 glchen Exp $
Author:
Guanling Chen

Field Summary
protected static java.lang.String[] _hex
           
protected static org.apache.log4j.Logger _log
           
protected  serp.util.Options _opts
           
protected  Transport _transport
           
protected  cern.jet.random.Uniform _unigen
           
(package private) static int counter
           
 
Constructor Summary
GroundHog(serp.util.Options opts)
           
 
Method Summary
 void connectionClosed(Address peer)
          Called when an connection closed.
 void connectionOpened(Address peer)
          Called when an connection opened.
 void dataReceived(Adu adu, Header header)
          Called when new data is received.
private  Adu getAdu(int evtlen)
           
private  int getAduSize(Adu adu)
           
private  long getNextInterval(cern.jet.random.Exponential exp)
           
private  void goExponential(int evtlen, Address dest, double lambda, int interval)
           
private  void goUniform(int evtlen, Address dest, int interval)
           
static void main(java.lang.String[] args)
           
 void run()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_log

protected static org.apache.log4j.Logger _log

_hex

protected static java.lang.String[] _hex

_opts

protected serp.util.Options _opts

_unigen

protected cern.jet.random.Uniform _unigen

_transport

protected Transport _transport

counter

static int counter
Constructor Detail

GroundHog

public GroundHog(serp.util.Options opts)
Method Detail

dataReceived

public void dataReceived(Adu adu,
                         Header header)
Description copied from interface: TransportListener
Called when new data is received.

Specified by:
dataReceived in interface TransportListener

connectionOpened

public void connectionOpened(Address peer)
Description copied from interface: TransportListener
Called when an connection opened.

Specified by:
connectionOpened in interface TransportListener

connectionClosed

public void connectionClosed(Address peer)
Description copied from interface: TransportListener
Called when an connection closed.

Specified by:
connectionClosed in interface TransportListener

run

public void run()
         throws java.lang.Exception
java.lang.Exception

goUniform

private void goUniform(int evtlen,
                       Address dest,
                       int interval)
                throws java.lang.Exception
java.lang.Exception

goExponential

private void goExponential(int evtlen,
                           Address dest,
                           double lambda,
                           int interval)
                    throws java.lang.Exception
java.lang.Exception

getNextInterval

private long getNextInterval(cern.jet.random.Exponential exp)

getAdu

private Adu getAdu(int evtlen)

getAduSize

private int getAduSize(Adu adu)
                throws java.lang.Exception
java.lang.Exception

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
java.lang.Exception