gps.util
Class LogServer

java.lang.Object
  extended by java.lang.Thread
      extended by gps.util.LogServer
All Implemented Interfaces:
java.lang.Runnable

public class LogServer
extends java.lang.Thread

log server handles concurrent log request, and runs in a seperate thread

Version:
1.2, 6/20/2005
Author:
Weishuai Yang

Nested Class Summary
 class LogServer.HandlerRecordPair
          a pare of handler and record.
 
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
LogServer()
          dummy constructor
 
Method Summary
static LogServer getInstance()
          get singleton instance
 void halt()
          hanlt log server
 void log(AsyncFileHandler h, java.util.logging.LogRecord r)
          asynchornous file handler call this function to write log record to the log server.
 void run()
          run a seperate thread to write each log record into the related file in order of the arrival time.
 
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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LogServer

public LogServer()
dummy constructor

Method Detail

getInstance

public static LogServer getInstance()
get singleton instance

Returns:
LogServer instance

log

public void log(AsyncFileHandler h,
                java.util.logging.LogRecord r)
asynchornous file handler call this function to write log record to the log server.

Parameters:
h - asynchornous file handler
r - record to be logged

run

public void run()
run a seperate thread to write each log record into the related file in order of the arrival time.

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

halt

public void halt()
hanlt log server