ParkNPark.client
Class ParkNParkClient

java.lang.Object
  extended by ParkNPark.client.ParkNParkClient
All Implemented Interfaces:
Runnable

public class ParkNParkClient
extends Object
implements Runnable

ParkNPark client


Field Summary
protected  int detectionTimeout
          The wait timeout to use during fault detections
protected  PrintStream err
          The original System.err instance
protected  int getLotsModeCount
          Logger instance
protected  int interRequestTime
          Time between requests
protected  Logger logger
          Logger instance
protected  boolean neverGiveUp
          When true, never give up when trying to contact the server
protected  int numClients
          Number of clients
protected  int numServers
          Number of servers
protected  ORB orb
          Our object request broker
protected  int recoveryTimeout
          The wait timeout to use during fault recoveries
protected  int replySize
          Size of reply
 
Constructor Summary
ParkNParkClient(ORB orb, int numClients, int numServers, int interRequestTime, int replySize, boolean neverGiveUp, int getLotsModeCount, int detectionTimeout, int recoveryTimeout)
          Creates a new ParkNParkClient instance that will use the given ORB to communicate with the server
 
Method Summary
private  void closeLogFiles()
          Close the log files and, if a problem arises, notify the user
static void main(String[] args)
          Convenience method that executes the ParkNParkClient from the command line
 void run()
          Runs the ParkNParkClient
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

orb

protected ORB orb
Our object request broker


numClients

protected int numClients
Number of clients


numServers

protected int numServers
Number of servers


neverGiveUp

protected boolean neverGiveUp
When true, never give up when trying to contact the server


interRequestTime

protected int interRequestTime
Time between requests


replySize

protected int replySize
Size of reply


getLotsModeCount

protected int getLotsModeCount
Logger instance


detectionTimeout

protected int detectionTimeout
The wait timeout to use during fault detections


recoveryTimeout

protected int recoveryTimeout
The wait timeout to use during fault recoveries


logger

protected Logger logger
Logger instance


err

protected PrintStream err
The original System.err instance

Constructor Detail

ParkNParkClient

public ParkNParkClient(ORB orb,
                       int numClients,
                       int numServers,
                       int interRequestTime,
                       int replySize,
                       boolean neverGiveUp,
                       int getLotsModeCount,
                       int detectionTimeout,
                       int recoveryTimeout)
Creates a new ParkNParkClient instance that will use the given ORB to communicate with the server

Parameters:
orb - The ORB to communicate with the server on
numClients - The number of clients in the current test
numServers - The number of servers in the current test
interRequestTime - The delay between each invocation, which is used when constructing the log file names
replySize - The size of the server's replies, which is used when constructing the log file names
neverGiveUp - When true, the client will never give up its attempt to contact the server, even if no primary is registered
detectionTimeout - The wait timeout to use during fault detections
recoveryTimeout - The wait timeout to use during fault recoveries
Method Detail

main

public static void main(String[] args)
Convenience method that executes the ParkNParkClient from the command line

Parameters:
args - The command-line arguments to use when starting the client

run

public void run()
Runs the ParkNParkClient

Specified by:
run in interface Runnable

closeLogFiles

private void closeLogFiles()
Close the log files and, if a problem arises, notify the user