simtools.logging
Class FileBufferHandler

java.lang.Object
  extended by java.util.logging.Handler
      extended by simtools.logging.LoggingEntryByteBuffer.Handler
          extended by simtools.logging.FileBufferHandler

public class FileBufferHandler
extends LoggingEntryByteBuffer.Handler


Field Summary
protected  java.nio.channels.FileChannel channel
           
protected  java.io.File file
           
protected  java.io.FileOutputStream stream
           
protected  java.lang.Object streamLock
           
 
Constructor Summary
FileBufferHandler(java.lang.String loggingOut)
          The constructor of the class.
 
Method Summary
 void close()
           
 void flush()
           
protected  void open()
           
protected  void write(java.nio.ByteBuffer bb)
           
 
Methods inherited from class simtools.logging.LoggingEntryByteBuffer.Handler
publish
 
Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

file

protected java.io.File file

channel

protected java.nio.channels.FileChannel channel

stream

protected java.io.FileOutputStream stream

streamLock

protected java.lang.Object streamLock
Constructor Detail

FileBufferHandler

public FileBufferHandler(java.lang.String loggingOut)
                  throws java.io.IOException
The constructor of the class.

Parameters:
loggingOut - The file to write the logs. If an absolute path is given, it will use it, else it will create the relative file using the user.home properties.
Throws:
java.io.IOException
Method Detail

open

protected void open()
             throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(java.nio.ByteBuffer bb)
              throws java.io.IOException
Specified by:
write in class LoggingEntryByteBuffer.Handler
Throws:
java.io.IOException

close

public void close()
           throws java.lang.SecurityException
Specified by:
close in class java.util.logging.Handler
Throws:
java.lang.SecurityException

flush

public void flush()
Specified by:
flush in class java.util.logging.Handler