org.testng.remote.strprotocol
Class BaseMessageSender

java.lang.Object
  extended by org.testng.remote.strprotocol.BaseMessageSender
All Implemented Interfaces:
IMessageSender
Direct Known Subclasses:
SerializedMessageSender, StringMessageSender

public abstract class BaseMessageSender
extends Object
implements IMessageSender


Field Summary
protected  Object m_ackLock
           
protected  Socket m_clientSocket
           
protected  BufferedReader m_inReader
          Used to receive ACK and STOP
protected  InputStream m_inStream
          Incoming message stream.
protected  OutputStream m_outStream
          Outgoing message stream.
 
Constructor Summary
BaseMessageSender(String host, int port)
           
 
Method Summary
 void connect()
          Starts the connection.
 void initReceiver()
          Initialize the receiver.
 void sendAck()
           
 void sendStop()
           
 void shutDown()
           
protected  void waitForAck()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.testng.remote.strprotocol.IMessageSender
receiveMessage, sendMessage
 

Field Detail

m_clientSocket

protected Socket m_clientSocket

m_ackLock

protected Object m_ackLock

m_outStream

protected OutputStream m_outStream
Outgoing message stream.


m_inStream

protected volatile InputStream m_inStream
Incoming message stream.


m_inReader

protected volatile BufferedReader m_inReader
Used to receive ACK and STOP

Constructor Detail

BaseMessageSender

public BaseMessageSender(String host,
                         int port)
Method Detail

connect

public void connect()
             throws IOException
Starts the connection.

Specified by:
connect in interface IMessageSender
Throws:
TestNGException - if an exception occurred while establishing the connection
IOException

sendAck

public void sendAck()
Specified by:
sendAck in interface IMessageSender

sendStop

public void sendStop()
Specified by:
sendStop in interface IMessageSender

initReceiver

public void initReceiver()
                  throws SocketTimeoutException
Description copied from interface: IMessageSender
Initialize the receiver.

Specified by:
initReceiver in interface IMessageSender
Throws:
SocketTimeoutException

shutDown

public void shutDown()
Specified by:
shutDown in interface IMessageSender

waitForAck

protected void waitForAck()


Copyright © 2011. All Rights Reserved.