|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.exolab.jms.tranlog.TransactionLog
The resource manager uses transaction logs to record the persistent records for the resource manager in case of recovery. All records are logged sequentially and each records has an associated XID. Log files have a finite size, after which they are closed and a new log file is opened. There is only one current transaction log file per resource manager.
Constructor Summary | |
TransactionLog(java.lang.String name,
boolean create)
Create a transaction log with the specified name, which includes the directory it will reside in. |
Method Summary | |
boolean |
canGarbageCollect()
Check if we can garbage collect this transaction log. |
void |
close()
Close the transaction log |
void |
destroy()
Destroy this transaction log, which basically removes it from the file system |
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
getName()
Return the name of the transaction log file |
void |
logTransactionData(ExternalXid txid,
long expiry,
java.lang.String rid,
java.lang.Object data)
Add an DataTransactionLogEntry using the specified txid,
rid and data |
void |
logTransactionState(ExternalXid txid,
long expiry,
java.lang.String rid,
TransactionState state)
Add an StateTransactionLogEntry using the specified txid,
rid and state |
java.util.HashMap |
recover()
Force a recovery of this log file. |
long |
size()
Return the size of the transaction log file. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TransactionLog(java.lang.String name, boolean create) throws TransactionLogException
Attempting to create a file that already exists or open a non-exisitent log file with throw the TransactionLogException exception.
name
- - the name of the transaction log absolute or finalvreate
- - flag inidicating whether to open or create the logTransactionLogException
- Method Detail |
public java.lang.String getName()
public void logTransactionState(ExternalXid txid, long expiry, java.lang.String rid, TransactionState state) throws TransactionLogException
StateTransactionLogEntry
using the specified txid,
rid and statetxid
- - the transaction identifierexpiry
- - expiry time for the transactionrid
- - the resource identifierstate
- - the transaction log stateTransactionLogException
- - if the entry cannot be createdpublic void logTransactionData(ExternalXid txid, long expiry, java.lang.String rid, java.lang.Object data) throws TransactionLogException
DataTransactionLogEntry
using the specified txid,
rid and datatxid
- - the transaction identifierexpiry
- - transaction expiry timerid
- - the resource identifierdata
- - the opaque data to writeTransactionLogException
- - if the entry cannot be createdpublic void close() throws TransactionLogException
TransactionLogException
- - if it fails to close the logpublic long size()
public java.util.HashMap recover() throws TransactionLogException
The returned data structure is a HashMap, where the key is a
ExternalXid
and the entries are LinkedList of BaseTransactionLogEntry
objects
TransactionLogException
- - if there is a prob recoveringpublic boolean canGarbageCollect()
public void destroy() throws TransactionLogException
TransactionLogException
- public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |