Connection
Keywords: com.prolixtech.jaminid.Connection class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.prolixtech.jaminid
Class Connection

    java.lang.Object
      java.lang.Thread
          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.
`protected void` | `sendString(byte[] bytes)`
`protected void` | `sendString(java.lang.Object string)` Sends a string to 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

### 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`

### sendString

    protected void sendString(java.lang.Object string)
                       throws java.io.IOException

  Sends a string to the client

  Parameters:
    `string` -
  Throws:
    `java.io.IOException`

### sendString

    protected void sendString(byte[] bytes)

### getGMTString

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

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD