dsnserver
Class ThreadLogging

java.lang.Object
  extended by java.lang.Thread
      extended by dsnserver.ThreadLogging
All Implemented Interfaces:
java.lang.Runnable

public class ThreadLogging
extends java.lang.Thread

This class is used to request the logs from the BTnode. It looks which nodes are here by looking to the dsninfo table and sends after some seconds a new log request to the next DSNnode in the table.

Author:
kaltt

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
(package private)  int MsgID
           
 Communication myComm
           
private static java.util.concurrent.Semaphore sem
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ThreadLogging(Communication myComm)
           
 
Method Summary
static void lock()
           
 void RequestLog(java.lang.String DSNID)
          It requests all MsgID's which are in DSN.request.
 void run()
          Thirst of all, it looks which nodes has resbonded to the last dsn ping.
static void unlock()
           
 void updateRequestLog(java.lang.String DSNID)
          It goes through DSN.received and evalutes which MsgID between the lowest and the highest MsgID in the DSN.received miss and write them to DSN.request.
 
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
 

Field Detail

myComm

public Communication myComm

sem

private static java.util.concurrent.Semaphore sem

MsgID

int MsgID
Constructor Detail

ThreadLogging

public ThreadLogging(Communication myComm)
Method Detail

run

public void run()
Thirst of all, it looks which nodes has resbonded to the last dsn ping. Afterwards it is doing following for each node:
-it sends a new slog get. (if before arrived a log it says that it needs just the logs after the highest MsgNr it becames before)
-it goes through the list with the recived MsgID and evalutes which MsgID's has to be requested additionaly.
-it requests the MsgId which are stored in the requested list.

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

updateRequestLog

public void updateRequestLog(java.lang.String DSNID)
It goes through DSN.received and evalutes which MsgID between the lowest and the highest MsgID in the DSN.received miss and write them to DSN.request.


RequestLog

public void RequestLog(java.lang.String DSNID)
It requests all MsgID's which are in DSN.request. If there is a sequence of following numbers, it requests them thogether.


lock

public static void lock()

unlock

public static void unlock()