com.prolixtech.jaminid
Class Connection

java.lang.Object
  extended by java.lang.Thread
      extended by com.prolixtech.jaminid.Connection
All Implemented Interfaces:
java.lang.Runnable

public class Connection
extends java.lang.Thread

The connection is a thread-of-service spanwed by the Daemon. The connection handles the IO part of the Response/Oracle/Request paradigm by creating the request and response objects, and calling the Oracle at the appropriate time to extract the output which will be send to the client.

Author:
Constantinos Michael TODO

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
Connection(java.net.Socket activeSocket, Daemon masterDaemon)
          default constructor to create a Connection
 
Method Summary
static java.lang.String getGMTString(java.util.Date d)
           
 java.lang.String getIPAddressString()
           
 void run()
          The thread runs here.
 
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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Connection

public Connection(java.net.Socket activeSocket,
                  Daemon masterDaemon)
           throws java.io.IOException
default constructor to create a Connection

Parameters:
activeSocket - the socket on which the connection was madee
masterDaemon - the daemon that spanwed this connection
Throws:
java.io.IOException
Method Detail

getIPAddressString

public java.lang.String getIPAddressString()

run

public void run()
The thread runs here. This essentially allows the Daemon to serve multiple threads. ALL IO is carried out here.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

getGMTString

public static java.lang.String getGMTString(java.util.Date d)