|
||||||||||
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 NotebookConstructor Summary | |
---|---|
DiskJournal()
Create an uninitialized disk journal. |
Method Summary | |
---|---|
void |
close()
Close the disk journal and the underlying files. |
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,
Set<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, Set<String> uniqueNames) throws IOException
log
in interface Journal
status
- transaction status to log. See Status
constants.gtrid
- raw GTRID of the transaction.uniqueNames
- unique names of the ResourceBean
s participating in
this transaction.
IOException
- in case of disk IO failure or if the disk journal is not open.public void force() throws IOException
force
in interface Journal
IOException
- in case of disk IO failure or if the disk journal is not open.public void open() throws IOException
open
in interface Journal
IOException
- in case of disk IO failure.public void close() throws IOException
close
in interface Journal
IOException
- in case of disk IO failure.public void shutdown()
Service
shutdown
in interface Service
public Map<Uid,TransactionLogRecord> collectDanglingRecords() throws IOException
collectDanglingRecords
in interface Journal
TransactionLogRecord
as value
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 |