MicroTAPAS
Class ComCenter

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

public class ComCenter
extends java.lang.Thread

This class implements a communication center for all the communicaiton that takes place between TAPAS nodes.


Field Summary
private  java.net.Socket client
          Temporary socket for handling communication
private static int comPort
          The ports to listen to/send from
private static boolean DEBUG
          Determines whether debug info to be sent to debug-server
private  boolean isActive
          Indicates wheter the listen-loop should be active
private  boolean isPNESServer
          Indicates wether this entity is used for regualr traffic or debug traffic.
private static int numOpenOut
           
private static int numReceived
          Statistics
private static int numSent
           
private  java.io.ObjectInputStream oip
          Strem to read objects from the socket
private  java.lang.Object parent
          Reference to the local MicroPNES/DebugServer instance
private  java.net.ServerSocket server
          Socket for incomming request/result
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ComCenter(DebugServer pParent, int pComPort)
          Constructor
ComCenter(MicroPNES pParent)
          Constructor
 
Method Summary
 void destroy()
          Method to shut down the server
private  void listen()
          Main method for incomming requests
 void run()
          Implement the run() method of the Thread interface.
 RequestResult send(RequestPars rp)
          Main method for outgoing requests
private  void sendDebug(DebugEvent de)
          Method to send debug events to the debug server.
 Item status()
          Status report of ComCenter in Item hierarchy of information elements.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, 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 static final boolean DEBUG
Determines whether debug info to be sent to debug-server

See Also:
Constant Field Values

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.


server

private java.net.ServerSocket server
Socket for incomming request/result


client

private java.net.Socket client
Temporary socket for handling communication


oip

private java.io.ObjectInputStream oip
Strem to read objects from the socket


comPort

private static int comPort
The ports to listen to/send from


isActive

private boolean isActive
Indicates wheter the listen-loop should be active


numReceived

private static int numReceived
Statistics


numSent

private static int numSent

numOpenOut

private static int numOpenOut
Constructor Detail

ComCenter

public ComCenter(MicroPNES pParent)
Constructor

Parameters:
pParent - Reference to the local MicroPNES instance

ComCenter

public ComCenter(DebugServer pParent,
                 int pComPort)
Constructor

Parameters:
pParent - Reference to the DebugServer instance
pComPort - The port number to listen for incomming requests
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

destroy

public void destroy()
Method to shut down the server

Overrides:
destroy in class java.lang.Thread

listen

private void listen()
             throws java.lang.Exception
Main method for incomming requests

java.lang.Exception

send

public RequestResult send(RequestPars rp)
Main method for outgoing requests

Parameters:
rp - The request to be sent to the receiver indicated in the object
Returns:
TAPAS style result

sendDebug

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

Returns:
de The DebugEvent to be sent.

status

public Item status()
Status report of ComCenter in Item hierarchy of information elements.

Returns:
Hierarchy of Item information elements


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.