org.csc.phynixx.loggersystem.logger
Interface IDataLogger

All Known Implementing Classes:
FileChannelDataLogger

public interface IDataLogger

A logger is enabled to write data in an atomic manner. The data is entirely written or the data is rejected. This class is not thread safe . Use facades to protect instances


Method Summary
 void close()
          close the Log files and perform necessary cleanup tasks.
 void destroy()
          destroys the logger and removes its resources.
 boolean isClosed()
           
 void open(AccessMode accessMode)
          opens the logger with the specified ACCESS_MODE.
 void reopen(AccessMode accessMode)
          reopens the datalogger.
 void replay(ILogRecordReplayListener replayListener)
          callback method to replay the data of the logger.
 long write(short type, byte[][] data)
          Sub-classes call this method to write log records with a specific record type.
 

Method Detail

write

long write(short type,
           byte[][] data)
           throws InterruptedException,
                  IOException
Sub-classes call this method to write log records with a specific record type.

Parameters:
type - a record type defined in LogRecordType.
data - record data to be logged.
Returns:
a log key that can be used to de-reference the record.

Throws:
InterruptedException
IOException

replay

void replay(ILogRecordReplayListener replayListener)
            throws IOException
callback method to replay the data of the logger.

Parameters:
replayListener -
Throws:
IOException

close

void close()
           throws IOException,
                  InterruptedException
close the Log files and perform necessary cleanup tasks. The logger could be reopen

Throws:
IOException
InterruptedException

isClosed

boolean isClosed()
Returns:
true if and if the logger is closed

open

void open(AccessMode accessMode)
          throws IOException
opens the logger with the specified ACCESS_MODE. If the logger isn't closed it is closed.

Parameters:
accessMode -
Throws:
IOException
See Also:
reopen(org.csc.phynixx.loggersystem.logger.channellogger.AccessMode)

reopen

void reopen(AccessMode accessMode)
            throws IOException,
                   InterruptedException
reopens the datalogger. It is assumed that the logger is open.
    READ   - position to 0, content cannot be changed or added
    WRITE  - position to 0 and resets the committed size to 0. Content is deleted (kind of reset)
    APPEND - position to the committed size. Content is not effected.
 

Parameters:
accessMode -
Throws:
IOException
InterruptedException

destroy

void destroy()
             throws IOException
destroys the logger and removes its resources. The logger cannot be reopened

Throws:
IOException


Copyright © 2015. All rights reserved.