MicroTAPAS.debug
Class Debug

java.lang.Object
  |
  +--MicroTAPAS.debug.Debug
All Implemented Interfaces:
java.lang.Runnable

public class Debug
extends java.lang.Object
implements java.lang.Runnable

Simple class to facilitate sending DebugEvents to DebugServer. The actual sending of the events are done by using a thread, because otherwise the system would hang for as long as the object is trying to connect to the server. Once the connection to the server failes, all subsequent calls to this instance will fail. (i.e. no re-initiation of connetion)


Field Summary
private static java.lang.String address
           
private  java.lang.Thread eventThread
           
private static java.lang.String ipSender
           
private static boolean isActive
           
private static int port
           
private static boolean waitForNotify
           
private static java.util.Vector vEvents
           
 
Constructor Summary
Debug(java.lang.String location)
          Constructor
Debug(java.lang.String pAddress, int pPort)
          Deprecated. Use Debug(String address) instead, where address is on the form :
 
Method Summary
 java.lang.String getAddress()
          Returns the concatenated address of the debug server
private  void init()
          Initialization of this Debug instance.
 void run()
          Implemnts the required run method of the Runnable interface
 boolean send(DebugEvent de)
          Adds a 'DebugEvent' to the local vector.
private  void sendEvents()
          Main loop for this thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ipSender

private static java.lang.String ipSender

address

private static java.lang.String address

port

private static int port

eventThread

private java.lang.Thread eventThread

waitForNotify

private static boolean waitForNotify

isActive

private static boolean isActive

vEvents

private static java.util.Vector vEvents
Constructor Detail

Debug

public Debug(java.lang.String pAddress,
             int pPort)
Deprecated. Use Debug(String address) instead, where address is on the form :

Constructor

Parameters:
pAddress - The address of the DebugServer.
pPort - The port on the DebugServer that is open for receiving DebugEvents.

Debug

public Debug(java.lang.String location)
Constructor

Method Detail

init

private void init()
Initialization of this Debug instance. Starts the thread handling the sending of incomming events.


run

public void run()
Implemnts the required run method of the Runnable interface

Specified by:
run in interface java.lang.Runnable

sendEvents

private void sendEvents()
Main loop for this thread. Takes care of the sending of 'DebugEvent' to the debugserver at location 'address:port'. The oldest event is sent first.


send

public boolean send(DebugEvent de)
Adds a 'DebugEvent' to the local vector. The thread sends these events asynchronously to the server. If the server is not active, severe DebugEvents (FATAL, FAULT & WARNING) are printed to standard out.

Parameters:
de - The DebugEvent to be sent to the DebugServer.
Returns:
Success indicator; FALSE indicates that thread is not running, and is probably due to DebugServer not running.

getAddress

public java.lang.String getAddress()
Returns the concatenated address of the debug server

Returns:
The address of the debug server


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.