gps.util
Class AsyncFileHandler

java.lang.Object
  extended by java.util.logging.Handler
      extended by java.util.logging.StreamHandler
          extended by java.util.logging.FileHandler
              extended by gps.util.AsyncFileHandler

public class AsyncFileHandler
extends java.util.logging.FileHandler

Asynchronous file handler, asynchronously handles log record. The purpose of this class is to intercept publish and close. Log records are published to a log server. The regular publish and close become AsynchPublish and AsynchClose.

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

Constructor Summary
AsyncFileHandler()
          constructor, simply call super class
AsyncFileHandler(java.lang.String pattern)
          constructor, simply call super class
AsyncFileHandler(java.lang.String pattern, boolean append)
          constructor, simply call super class
AsyncFileHandler(java.lang.String pattern, int limit, int count)
          constructor, simply call super class
AsyncFileHandler(java.lang.String pattern, int limit, int count, boolean append)
          constructor, simply call super class
 
Method Summary
 void close()
          Asynchronous close.
 boolean isClosed()
          Asynchronous isClose.
 void publish(java.util.logging.LogRecord record)
          Asynchronous publish.
 void syncClose()
          call regular close
 void syncPublish(java.util.logging.LogRecord record)
          call regular publish
 
Methods inherited from class java.util.logging.StreamHandler
flush, isLoggable, setEncoding
 
Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, setErrorManager, setFilter, setFormatter, setLevel
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsyncFileHandler

public AsyncFileHandler()
                 throws java.io.IOException,
                        java.lang.SecurityException
constructor, simply call super class

Throws:
java.io.IOException
java.lang.SecurityException

AsyncFileHandler

public AsyncFileHandler(java.lang.String pattern)
                 throws java.io.IOException,
                        java.lang.SecurityException
constructor, simply call super class

Throws:
java.io.IOException
java.lang.SecurityException

AsyncFileHandler

public AsyncFileHandler(java.lang.String pattern,
                        boolean append)
                 throws java.io.IOException,
                        java.lang.SecurityException
constructor, simply call super class

Throws:
java.io.IOException
java.lang.SecurityException

AsyncFileHandler

public AsyncFileHandler(java.lang.String pattern,
                        int limit,
                        int count)
                 throws java.io.IOException,
                        java.lang.SecurityException
constructor, simply call super class

Throws:
java.io.IOException
java.lang.SecurityException

AsyncFileHandler

public AsyncFileHandler(java.lang.String pattern,
                        int limit,
                        int count,
                        boolean append)
                 throws java.io.IOException,
                        java.lang.SecurityException
constructor, simply call super class

Throws:
java.io.IOException
java.lang.SecurityException
Method Detail

publish

public void publish(java.util.logging.LogRecord record)
Asynchronous publish. If asynchronous log server existing, publish to log server, otherwise use regular synchronous publish

Overrides:
publish in class java.util.logging.FileHandler
Parameters:
record - description of the log event. A null record is silently ignored and is not published

syncPublish

public void syncPublish(java.util.logging.LogRecord record)
call regular publish

Parameters:
record - logrecord to be published

close

public void close()
           throws java.lang.SecurityException
Asynchronous close. Just set close flag, doesn't really colse

Overrides:
close in class java.util.logging.FileHandler
Throws:
java.lang.SecurityException

syncClose

public void syncClose()
               throws java.lang.SecurityException
call regular close

Throws:
java.lang.SecurityException

isClosed

public boolean isClosed()
Asynchronous isClose. Check close status.

Returns:
true if closed, otherwise false