net.flexmojos.oss.test.monitor
Class AbstractSocketThread

java.lang.Object
  extended by org.codehaus.plexus.logging.AbstractLogEnabled
      extended by net.flexmojos.oss.test.AbstractControlledThread
          extended by net.flexmojos.oss.test.monitor.AbstractSocketThread
All Implemented Interfaces:
Runnable, ControlledThread, org.codehaus.plexus.logging.LogEnabled
Direct Known Subclasses:
AsVmPing, ResultHandler

public abstract class AbstractSocketThread
extends AbstractControlledThread
implements ControlledThread


Field Summary
protected  Socket clientSocket
           
protected  InputStream in
           
protected  OutputStream out
           
protected  ServerSocket serverSocket
           
 int testPort
           
 
Fields inherited from class net.flexmojos.oss.test.AbstractControlledThread
error, status
 
Constructor Summary
AbstractSocketThread()
           
 
Method Summary
protected  void closeClientSocket()
           
protected abstract  int getFirstConnectionTimeout()
           
protected abstract  int getTestPort()
           
protected abstract  void handleRequest()
           
protected  void openClientSocket()
           
protected  void reset()
           
 void run()
           
 void stop()
           
 
Methods inherited from class net.flexmojos.oss.test.AbstractControlledThread
getError, getStatus, launch, lock, unlock
 
Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.flexmojos.oss.test.ControlledThread
getError, getStatus, lock, unlock
 

Field Detail

serverSocket

protected ServerSocket serverSocket

clientSocket

protected Socket clientSocket

in

protected InputStream in

out

protected OutputStream out

testPort

public int testPort
Constructor Detail

AbstractSocketThread

public AbstractSocketThread()
Method Detail

run

public void run()
Specified by:
run in interface Runnable

handleRequest

protected abstract void handleRequest()
                               throws SocketTimeoutException,
                                      SocketException,
                                      IOException
Throws:
SocketTimeoutException
SocketException
IOException

getFirstConnectionTimeout

protected abstract int getFirstConnectionTimeout()

getTestPort

protected abstract int getTestPort()

openClientSocket

protected void openClientSocket()
                         throws SocketException,
                                IOException,
                                SocketTimeoutException
Throws:
SocketException
IOException
SocketTimeoutException

closeClientSocket

protected void closeClientSocket()

stop

public void stop()
Specified by:
stop in interface ControlledThread

reset

protected void reset()
Overrides:
reset in class AbstractControlledThread


Copyright © 2008–2014 flexmojos. All rights reserved.