|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbitronix.tm.journal.DiskJournal
public class DiskJournal
Simple implementation of a journal that writes on a two-files disk log.
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 Summary | |
|---|---|
DiskJournal()
Create an uninitialized disk journal. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DiskJournal()
| Method Detail |
|---|
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
force in interface Journaljava.io.IOException - in case of disk IO failure or if the disk journal is not open.
public void open()
throws java.io.IOException
open in interface Journaljava.io.IOException - in case of disk IO failure.
public void close()
throws java.io.IOException
close in interface Journaljava.io.IOException - in case of disk IO failure.public void shutdown()
Service
shutdown in interface Service
public java.util.Map<Uid,TransactionLogRecord> collectDanglingRecords()
throws java.io.IOException
collectDanglingRecords in interface JournalTransactionLogRecord as value
java.io.IOException - in case of disk IO failure or if the disk journal is not open.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||