com.transjam.util
Class ClientMonitor

java.lang.Object
  |
  +--com.transjam.util.ProtocolReader
        |
        +--com.transjam.util.ClientMonitor
All Implemented Interfaces:
java.lang.Runnable, XMLListener

public class ClientMonitor
extends ProtocolReader
implements java.lang.Runnable

Reads TransjamMessages from socket connected to client. Loops in a Thread and calls ClientMonitorListener.

Author:
(C) 1997-2001 Phil Burk, SoftSynth.com, All Rights Reserved

Fields inherited from class com.transjam.util.ProtocolReader
reader
 
Constructor Summary
ClientMonitor(ClientMonitorListener pClientMonitorListener)
           
 
Method Summary
 java.net.Socket getSocket()
           
 void gotMessage(TransjamMessage msg)
           
 void run()
           
 void setSocket(java.net.Socket pSocket, int timeoutMSec)
          Use this network socket for communication with server.
 void start()
          Start a thread that reads messages from the server, parses them and calls processMessage.
 void stop()
          Tell background thread to stop reading from socket.
 
Methods inherited from class com.transjam.util.ProtocolReader
beginElement, endElement, foundContent, parse, setStream
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientMonitor

public ClientMonitor(ClientMonitorListener pClientMonitorListener)
Method Detail

setSocket

public void setSocket(java.net.Socket pSocket,
                      int timeoutMSec)
               throws java.io.IOException
Use this network socket for communication with server.

getSocket

public java.net.Socket getSocket()

start

public void start()
Start a thread that reads messages from the server, parses them and calls processMessage.

stop

public void stop()
Tell background thread to stop reading from socket.

run

public void run()
Specified by:
run in interface java.lang.Runnable

gotMessage

public void gotMessage(TransjamMessage msg)
                throws java.io.IOException
Overrides:
gotMessage in class ProtocolReader