Package bitronix.tm.journal
Class TransactionLogCursor
java.lang.Object
bitronix.tm.journal.TransactionLogCursor
Used to read
TransactionLogRecord objects from a log file.- Author:
- lorban
-
Constructor Summary
ConstructorsConstructorDescriptionTransactionLogCursor(File file) Create a TransactionLogCursor that will read from the specified file. -
Method Summary
-
Constructor Details
-
TransactionLogCursor
Create a TransactionLogCursor that will read from the specified file. This opens a new read-only file descriptor.- Parameters:
file- the file to read logs from- Throws:
IOException- if an I/O error occurs.
-
-
Method Details
-
readLog
Fetch the next TransactionLogRecord from log, recalculating the CRC and checking it against the stored one. InvalidChecksumException is thrown if the check fails.- Returns:
- the TransactionLogRecord or null if the end of the log file has been reached
- Throws:
IOException- if an I/O error occurs.
-
readLog
Fetch the next TransactionLogRecord from log.- Parameters:
skipCrcCheck- if set to false, the method will thow an InvalidChecksumException if the CRC on disk does not match the recalculated one. Otherwise, the CRC is not recalculated nor checked agains the stored one.- Returns:
- the TransactionLogRecord or null if the end of the log file has been reached
- Throws:
IOException- if an I/O error occurs.
-
close
Close the cursor and the underlying file- Throws:
IOException- if an I/O error occurs.
-