Class ModelServerWorker

java.lang.Object
   |
   +----java.lang.Thread
           |
           +----ModelServerWorker

public class ModelServerWorker
extends Thread
Network ModelUpdate server for managing an individual client connection.

Version:
$Revision: 1.9 $, $Date: 2000/10/12 14:09:49 $
Author:
Mike Spengler, Joseph Thomas

Variable Index

 o msv
Pointer to the ModelServer which owns us
 o muQ
The FIFO queue of ModelUpdates waiting to be processed
 o net
Pointer to the ATMNetwork which represents this run
 o oos
The output stream to which ModelUpdates will be written
 o qpause
Number of milliseconds to pause between update queue runs
 o rcount
The reference count for number of objects processed
 o sock
The socket connection to the listener this worker is feeding

Constructor Index

 o ModelServerWorker(ModelServer, Socket, ConfigMgr)
Class constructor.

Method Index

 o closeOut()
Closes the client socket and removes self from worker list.
 o enqueueUpdate(ModelUpdate)
Queues the specified ModelUpdate to our internal processing queue.
 o finalize()
Ensures that the client socket gets closed.
 o queueSize()
Gets the number of components currently on the processing queue.
 o run()
Adds self to the worker list and then processes the entries on our internal processing queue.

Variables

 o qpause
 private static final int qpause
Number of milliseconds to pause between update queue runs

 o muQ
 private FIFO muQ
The FIFO queue of ModelUpdates waiting to be processed

 o oos
 private ObjectOutputStream oos
The output stream to which ModelUpdates will be written

 o msv
 private ModelServer msv
Pointer to the ModelServer which owns us

 o sock
 private Socket sock
The socket connection to the listener this worker is feeding

 o net
 private ATMNetwork net
Pointer to the ATMNetwork which represents this run

 o rcount
 private int rcount
The reference count for number of objects processed

Constructors

 o ModelServerWorker
 public ModelServerWorker(ModelServer msv,
                          Socket sock,
                          ConfigMgr cm)
Class constructor.

Parameters:
msv - our parent server thread
sock - accepted client connection socket
cm - the configuration manager containing all configuration information for this run

Methods

 o run
 public void run()
Adds self to the worker list and then processes the entries on our internal processing queue.

Overrides:
run in class Thread
 o enqueueUpdate
 public void enqueueUpdate(ModelUpdate update)
Queues the specified ModelUpdate to our internal processing queue.

Parameters:
update - the ModelUpdate to be queued
 o queueSize
 public int queueSize()
Gets the number of components currently on the processing queue.

Returns:
the count of components on the processing queue
 o closeOut
 private void closeOut()
Closes the client socket and removes self from worker list.

 o finalize
 protected void finalize()
Ensures that the client socket gets closed.

Overrides:
finalize in class Object