fr.ifremer.isisfish.logging.console
Class LogConsoleHandler

java.lang.Object
  extended by fr.ifremer.isisfish.logging.console.LogConsoleHandler
All Implemented Interfaces:
AdjustmentListener, MouseWheelListener, PropertyChangeListener, EventListener

public class LogConsoleHandler
extends Object
implements PropertyChangeListener, MouseWheelListener, AdjustmentListener

This class is responsible of provinding LogRecord, it deals with LogReecord stored in a file with a serializedForm for performance issue.

Use one LogConsoleHandler for one log file

Author:
chemit

Field Summary
protected  boolean dontAdjust
          a flag to block scroll bar adjustement events
protected  List<LineReaderUtil.LevelsLineReader> levelsReaders
          list of LevelsReader
protected  LogMail logMail
          the dialog to send mail
protected  LogConsoleModel model
          ui model to be used in dialog
protected  PropertyChangeSupport propertyListeners
           
protected  LineReader reader
          the current line reader
protected  File readerDirectory
          the directory where store readers
protected  org.nuiton.widget.StatusBar statusBar
          the console status bar where to notify user events
 
Constructor Summary
LogConsoleHandler(LogConsoleModel model)
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
           
 void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
           
 void adjustmentValueChanged(AdjustmentEvent e)
           
protected  void changeFilter()
           
 void close()
          stop the handler and all internal services
protected  void finalize()
           
protected  LineReader getLevelReader(int levels)
           
protected  LineReader getPatternReader(String searchText, LineReader parent)
           
 org.nuiton.widget.StatusBar getStatusBar()
           
 void mouseWheelMoved(MouseWheelEvent e)
           
 void openLogMail()
           
protected  void openReader(LineReader reader)
           
 void propertyChange(PropertyChangeEvent evt)
           
 void read(long offset)
          read the required frame from current reader
 void removePropertyChangeListener(PropertyChangeListener listener)
           
 void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
           
 void setStatusBar(org.nuiton.widget.StatusBar statusBar)
           
 void start()
          start the handler (will start all internal services required)
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

reader

protected LineReader reader
the current line reader


levelsReaders

protected List<LineReaderUtil.LevelsLineReader> levelsReaders
list of LevelsReader


model

protected LogConsoleModel model
ui model to be used in dialog


readerDirectory

protected File readerDirectory
the directory where store readers


dontAdjust

protected boolean dontAdjust
a flag to block scroll bar adjustement events


statusBar

protected org.nuiton.widget.StatusBar statusBar
the console status bar where to notify user events


logMail

protected LogMail logMail
the dialog to send mail


propertyListeners

protected PropertyChangeSupport propertyListeners
Constructor Detail

LogConsoleHandler

public LogConsoleHandler(LogConsoleModel model)
                  throws IOException
Throws:
IOException
Method Detail

start

public void start()
           throws IOException
start the handler (will start all internal services required)

Throws:
IOException - if any

close

public void close()
           throws Exception
stop the handler and all internal services

Throws:
Exception - if any problem while closing operation

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

read

public void read(long offset)
          throws IOException
read the required frame from current reader

Parameters:
offset - the offset to use
Throws:
IOException - if any problem while reading

mouseWheelMoved

public void mouseWheelMoved(MouseWheelEvent e)
Specified by:
mouseWheelMoved in interface MouseWheelListener

adjustmentValueChanged

public void adjustmentValueChanged(AdjustmentEvent e)
Specified by:
adjustmentValueChanged in interface AdjustmentListener

propertyChange

public void propertyChange(PropertyChangeEvent evt)
Specified by:
propertyChange in interface PropertyChangeListener

changeFilter

protected void changeFilter()

getPatternReader

protected LineReader getPatternReader(String searchText,
                                      LineReader parent)

getLevelReader

protected LineReader getLevelReader(int levels)
                             throws IOException
Throws:
IOException

openReader

protected void openReader(LineReader reader)
                   throws IOException
Throws:
IOException

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)

addPropertyChangeListener

public void addPropertyChangeListener(String propertyName,
                                      PropertyChangeListener listener)

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)

removePropertyChangeListener

public void removePropertyChangeListener(String propertyName,
                                         PropertyChangeListener listener)

getStatusBar

public org.nuiton.widget.StatusBar getStatusBar()

setStatusBar

public void setStatusBar(org.nuiton.widget.StatusBar statusBar)

openLogMail

public void openLogMail()


Copyright © 1999-2012 CodeLutin. All Rights Reserved.