com.monoserv
Class MonoServerInstance

java.lang.Object
  extended by java.lang.Thread
      extended by com.monoserv.MonoServerInstance
All Implemented Interfaces:
java.lang.Runnable

public class MonoServerInstance
extends java.lang.Thread

This is a thread that is started for each new socket connection that is accepted. It will be responsible for running the module's methods. At the end, the socket is closed and the thread dies.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
MonoServerInstance(ChainManager cm)
           
 
Method Summary
 void run()
          Overriden from Thread's run, this will generate a new IModuleData object and call the "readData(Socket)" function on that object.
 void SaveSocket(java.net.Socket sock)
          This is used to save a copy of the socket that is returned from the ServerSocket.accept() so it can directly communicate with the client.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MonoServerInstance

public MonoServerInstance(ChainManager cm)
Method Detail

SaveSocket

public void SaveSocket(java.net.Socket sock)
This is used to save a copy of the socket that is returned from the ServerSocket.accept() so it can directly communicate with the client. In reality, it just passes to the module which does the actual communication.

Parameters:
sock - The socket representing the client that we are connected to

run

public void run()
Overriden from Thread's run, this will generate a new IModuleData object and call the "readData(Socket)" function on that object. It will then call the "RunThroughModuleBlocks" method of the ChainManager. This in turn calls the WriteResult(IModuleData) object which will take the generated output and send it over the socket connection. A RuntimeException is thrown if anything fails to load or fails in any other way.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread
Throws:
java.lang.RuntimeException - If an error occurs