net.logAnalyzer.handlers
Class MemoryLogHandler

java.lang.Object
  extended bynet.logAnalyzer.handlers.AbstractLogHandler
      extended bynet.logAnalyzer.handlers.MemoryLogHandler
All Implemented Interfaces:
LALogHandler, java.lang.Runnable

public class MemoryLogHandler
extends AbstractLogHandler

This log handler saves messageLabel in memory. You must not use it for large log files.

Version:
0.1
Author:
Karim REFEYTON

Field Summary
static int MAXSIZE_RECOMMENDED
          Maximum log file size recommended to use a MemoryLogHangler.
 
Constructor Summary
MemoryLogHandler(FilesSetReader input, java.lang.String pattern)
           
 
Method Summary
 int getSize()
          Modification to the inherited behavior.
protected  void initParsing()
          Modification to the inherited behavior.
protected  LAMessage loadMessage(int index)
          Modification to the inherited behavior.
protected  void saveMessage(LAMessage message, long pointer)
          Modification to the inherited behavior.
 
Methods inherited from class net.logAnalyzer.handlers.AbstractLogHandler
addLogHandlerListener, fireEndParsing, fireStartParsing, fireStepParsing, getAnalyzers, getConverter, getConverter, getConverterIndex, getConverters, getFileLength, getFilePointer, getLastException, getMaxRecords, getMessage, getMessageConverter, getMessages, getPercentDone, getReader, isParsing, parse, parseMessage, readNextLine, releaseParsing, removeLogHandlerListener, run, setAnalyzers, setMaxRecords
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAXSIZE_RECOMMENDED

public static final int MAXSIZE_RECOMMENDED
Maximum log file size recommended to use a MemoryLogHangler. If the file is longer than MAXSIZE_RECOMMENDED, you must use a OnDemandLogHandler for better performances and to avoid OutOfMemoryError.

See Also:
Constant Field Values
Constructor Detail

MemoryLogHandler

public MemoryLogHandler(FilesSetReader input,
                        java.lang.String pattern)
                 throws java.io.FileNotFoundException,
                        NoConverterException
Parameters:
input -
pattern -
Throws:
java.io.FileNotFoundException
NoConverterException
Method Detail

getSize

public int getSize()
Modification to the inherited behavior.

Specified by:
getSize in interface LALogHandler
Specified by:
getSize in class AbstractLogHandler
Returns:
physical number of messages.
See Also:
LALogHandler.getSize()

loadMessage

protected LAMessage loadMessage(int index)
Modification to the inherited behavior.

Specified by:
loadMessage in class AbstractLogHandler
Parameters:
index - Index of the messageLabel to load.
Returns:
Message.
See Also:
AbstractLogHandler.loadMessage(int)

saveMessage

protected void saveMessage(LAMessage message,
                           long pointer)
Modification to the inherited behavior.

Specified by:
saveMessage in class AbstractLogHandler
Parameters:
message - Parsed messageLabel.
pointer - File pointer to the start of the messageLabel.
See Also:
AbstractLogHandler.saveMessage(LAMessage, long)

initParsing

protected void initParsing()
                    throws java.io.IOException
Modification to the inherited behavior.

Overrides:
initParsing in class AbstractLogHandler
Throws:
java.io.IOException - If an error occures.
See Also:
AbstractLogHandler.initParsing()


Copyright © 2006 null. All Rights Reserved.