|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.csc.phynixx.loggersystem.logger.channellogger.FileChannelDataLogger
public class FileChannelDataLogger
Logger uses a TAEnabledRandomAccessFile
to persist the data.
If the Logger is open, it holds a lock on
This class is not thread safe . Use facades to protect instances
Constructor Summary | |
---|---|
FileChannelDataLogger(File logFileAccess,
AccessMode aceessMode)
Opens a logger on base of die given logfile. |
Method Summary | |
---|---|
void |
close()
close the Log files and perform necessary cleanup tasks. |
void |
destroy()
destroys the logger and removes its resources. |
AccessMode |
getAccessMode()
|
boolean |
isClosed()
|
void |
open(AccessMode accessMode)
opens the logger with the specified ACCESS_MODE. |
void |
reopen(AccessMode accessMode)
reopens the datalogger. |
void |
replay(ILogRecordReplayListener replay)
the records a recovered from the format described in write(short, byte[][]) |
String |
toString()
|
void |
write(short type,
byte[] record)
|
long |
write(short type,
byte[][] records)
+-- length of records[0] +-- data of records[0] +-- length of records[1] +-- data of records[1] . . . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FileChannelDataLogger(File logFileAccess, AccessMode aceessMode) throws IOException
AccessMode.WRITE
, so you can start writting date
logFileAccess
-
IOException
Method Detail |
---|
public AccessMode getAccessMode()
public void open(AccessMode accessMode) throws IOException
open
in interface IDataLogger
accessMode
-
IOException
IDataLogger.reopen(org.csc.phynixx.loggersystem.logger.channellogger.AccessMode)
public void reopen(AccessMode accessMode) throws IOException
reopen
in interface IDataLogger
accessMode
-
IOException
IllegalStateException
- logger isn't openpublic void write(short type, byte[] record) throws IOException
IOException
public long write(short type, byte[][] records) throws IOException
+-- length of records[0] +-- data of records[0] +-- length of records[1] +-- data of records[1] . . .this format ensures that the record could be recovered
write
in interface IDataLogger
type
- a record type defined in LogRecordType.records
-
IOException
public void close() throws IOException
IDataLogger
close
in interface IDataLogger
IOException
public void replay(ILogRecordReplayListener replay) throws IOException
write(short, byte[][])
replay
in interface IDataLogger
replay
- replayListener
IOException
public boolean isClosed()
isClosed
in interface IDataLogger
public void destroy() throws IOException
IDataLogger
destroy
in interface IDataLogger
IOException
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |