public class DiskJournal extends java.lang.Object implements Journal
Files are pre-allocated in size, never grow and when the first one is full, dangling records are copied to the second file and logging starts again on the latter.
This implementation is not highly efficient but quite robust and simple. It is based on one of the implementations proposed by Mike Spille.
Configurable properties are all starting with bitronix.tm.journal.disk.
Configuration,
XA Exposed, Part III: The Implementor's Notebook| Constructor and Description |
|---|
DiskJournal()
Create an uninitialized disk journal.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the disk journal and the underlying files.
|
java.util.Map<Uid,TransactionLogRecord> |
collectDanglingRecords()
Collect all dangling records of the active log file.
|
void |
force()
Force active log file to synchronize with the underlying disk device.
|
void |
log(int status,
Uid gtrid,
java.util.Set<java.lang.String> uniqueNames)
Log a new transaction status to journal.
|
void |
open()
Open the disk journal.
|
void |
shutdown()
Shutdown the service and free all held resources.
|
public DiskJournal()
public void log(int status,
Uid gtrid,
java.util.Set<java.lang.String> uniqueNames)
throws java.io.IOException
log in interface Journalstatus - transaction status to log. See Status constants.gtrid - raw GTRID of the transaction.uniqueNames - unique names of the ResourceBeans participating in
this transaction.java.io.IOException - in case of disk IO failure or if the disk journal is not open.public void force()
throws java.io.IOException
public void open()
throws java.io.IOException
public void close()
throws java.io.IOException
public void shutdown()
Servicepublic java.util.Map<Uid,TransactionLogRecord> collectDanglingRecords() throws java.io.IOException
collectDanglingRecords in interface JournalTransactionLogRecord as valuejava.io.IOException - in case of disk IO failure or if the disk journal is not open.Copyright © 2006-2022 Bitronix Software. All Rights Reserved.