MicroTAPAS
Class ConnectionHandler

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--MicroTAPAS.ConnectionHandler
All Implemented Interfaces:
java.lang.Runnable

public class ConnectionHandler
extends java.lang.Thread

This class handles an incomming request of type RequestPars, by forwarding the request to the local MicroPNES instance and wait for the result of type RequestResult. When the result is received, it will be sent back through the same socket to the sender of the request.


Field Summary
private  java.net.Socket client
          The socket to handle incomming requests from.
private  boolean DEBUG
          Debug indicator.
private  boolean isPNESServer
          Indicates wether this entity is used for regualr traffic or debug traffic.
private  java.lang.Object parent
          Reference to the local MicroPNES/DebugServer instance.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ConnectionHandler(DebugServer pParent, java.net.Socket pClient)
          Constructor
ConnectionHandler(MicroPNES pParent, java.net.Socket pClient)
          Constructor
 
Method Summary
private  void handle()
          Main method to handle the incomming request
 void run()
          Implement the run() method of the Thread interface.
private  void sendDebug(DebugEvent de)
          Method to send debug events to the debug server.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, 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
 

Field Detail

DEBUG

private boolean DEBUG
Debug indicator.


parent

private java.lang.Object parent
Reference to the local MicroPNES/DebugServer instance.


isPNESServer

private boolean isPNESServer
Indicates wether this entity is used for regualr traffic or debug traffic.


client

private java.net.Socket client
The socket to handle incomming requests from.

Constructor Detail

ConnectionHandler

public ConnectionHandler(MicroPNES pParent,
                         java.net.Socket pClient)
Constructor

Parameters:
pParent - Reference to the local MicroPNES instance
pClient - the socket that contains the incomming request

ConnectionHandler

public ConnectionHandler(DebugServer pParent,
                         java.net.Socket pClient)
Constructor

Parameters:
pParent - Reference to the local MicroPNES instance
pClient - the socket that contains the incomming request
Method Detail

run

public void run()
Implement the run() method of the Thread interface.

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

handle

private void handle()
             throws java.lang.Exception
Main method to handle the incomming request

java.lang.Exception

sendDebug

private void sendDebug(DebugEvent de)
Method to send debug events to the debug server.

Returns:
de The DebugEvent to be sent.


The Telematics Architecture for Plug-and-Play Systems (TAPAS) is a research project undertaken by the Norwegian University of Science and Technology's Telematics department which aims at developing an architecture for network-based service systems with a) flexibility and adaptability, b) robustness and survivability, and c) QoS awareness and resource control.

More information can be found at the project's homepage at http://tapas.item.ntnu.no and the project manager, Professor Finn Arve Aagesen, can be reached at finn.arve.aagesen@item.ntnu.no.