public class MXTransactionImpl extends java.lang.Object implements MXTransaction
MXTransaction
InvalidStatus
Constructor and Description |
---|
MXTransactionImpl(java.lang.Object id)
Construct a transaction with the specified ID.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Transactable txn)
Add a Transactable object to the list of objects coordinated by this transaction.
|
void |
add(Transactable txn,
long status)
Add a transactable object to the transaction.
|
void |
clear()
clears the transactable array.
|
void |
clearTxnPropertyMap()
Clears the transaction property map after commit or rollback
|
void |
commit()
Commit the transaction.
|
void |
commitTransaction(MXTransaction txn)
Commit the transaction
|
void |
fireEventsAfterDB(MXTransaction txn)
fire events for all mbos in the transaction after db operation.
|
void |
fireEventsAfterDBCommit(MXTransaction txn)
fire events for all mbos in the transaction after db commit.
|
void |
fireEventsBeforeDB(MXTransaction txn)
fire events for all mbos in the transaction before db operation.
|
boolean |
getBoolean(java.lang.String keyString)
Gets the value from the Hashtable for the specified KeyString.
|
java.lang.Object |
getID()
Return the unique ID of the transaction.
|
int |
getInt(java.lang.String keyString)
Gets the value from the Hashtable for the specified KeyString.
|
int |
getSize()
gets the Size of the transactable array.
|
java.lang.String |
getString(java.lang.String keyString)
Gets the value from the Hashtable for the specified KeyString.
|
long |
getTransactionStatus(Transactable t)
Returns the transactable status of specified transactable.
|
java.util.Map<java.lang.Object,java.lang.Object> |
getTxnPropertyMap(Transactable t)
Get the transaction property map for the transactable
|
int |
indexOf(Transactable t)
Returns the index (0 based) of the specified object in the transaction.
|
void |
put(java.lang.String keyString,
boolean value)
Stores the value of keyStrings and values in the hashtable.
|
void |
put(java.lang.String keyString,
java.lang.String value)
Stores the value of keyStrings and values in the hashtable.
|
boolean |
remove(Transactable t)
removes the Transactable object from the transactable array.
|
void |
rollback()
Rollback the transaction
|
void |
rollbackTransaction(MXTransaction txn)
Rollback the transaction
|
void |
save()
Save the transaction to storage
|
void |
saveTransaction(MXTransaction txn)
Save the transaction.
|
void |
setEventFired(boolean flag)
Sets the event fired flag.
|
void |
setIndexOf(Transactable tsb,
int order)
First it will remove the transactable object from the transactable vector if the transactable
object is found.
|
void |
setTxnPropertyMap(Transactable t,
java.util.Map<java.lang.Object,java.lang.Object> map)
Set the transaction property map for the transactable
|
void |
undoTransaction(MXTransaction txn)
Undo a transaction if it has been committed.
|
void |
validate()
Validate the transaction
|
boolean |
validateTransaction(MXTransaction txn)
validate transaction.
|
public MXTransactionImpl(java.lang.Object id) throws java.rmi.RemoteException
id
- Unique ID for the transactionjava.rmi.RemoteException
- Network ErrorMXServer
public java.lang.Object getID()
getID
in interface MXTransaction
public void add(Transactable txn) throws java.rmi.RemoteException
add
in interface MXTransaction
txn
- Transactable objectjava.rmi.RemoteException
- Network ErrorTransactable
public void add(Transactable txn, long status) throws java.rmi.RemoteException
MXTransaction
add
in interface MXTransaction
txn
- Transactable Objectjava.rmi.RemoteException
- Network Errorpublic void save() throws MXException, java.rmi.RemoteException
save
in interface MXTransaction
MXException
- Error while savingjava.rmi.RemoteException
- Network errorpublic void commit() throws MXException, java.rmi.RemoteException
commit
in interface MXTransaction
MXException
- Error while savingjava.rmi.RemoteException
- Network errorpublic void rollback() throws MXException, java.rmi.RemoteException
rollback
in interface MXTransaction
MXException
- Error while rolling backjava.rmi.RemoteException
- Network Errorpublic void validate() throws MXException, java.rmi.RemoteException
MXException
- Error while rolling backjava.rmi.RemoteException
- Network Errorpublic void saveTransaction(MXTransaction txn) throws MXException, java.rmi.RemoteException
saveTransaction
in interface Transactable
txn
- Transaction to save. This method is called when
there are nested transactionsMXException
- Error while savingjava.rmi.RemoteException
- Network errorpublic void commitTransaction(MXTransaction txn) throws MXException, java.rmi.RemoteException
commitTransaction
in interface Transactable
txn
- Transaction that caused the commit. This is used
for nested transactions.MXException
- Error while committingjava.rmi.RemoteException
- Network errorpublic void rollbackTransaction(MXTransaction txn) throws MXException, java.rmi.RemoteException
rollbackTransaction
in interface Transactable
txn
- Transaction that caused the rollback. Used for
nested transactionsMXException
- Error while rolling backjava.rmi.RemoteException
- Network errorpublic void undoTransaction(MXTransaction txn) throws MXException, java.rmi.RemoteException
undoTransaction
in interface Transactable
txn
- Transaction that caused the undo. Used for nested
transactionsMXException
- Error while undoingjava.rmi.RemoteException
- Network errorpublic boolean validateTransaction(MXTransaction txn) throws MXException, java.rmi.RemoteException
validateTransaction
in interface Transactable
txn
- Transaction that caused the saveMXException
- Error while committingjava.rmi.RemoteException
- Network errorpublic void fireEventsBeforeDB(MXTransaction txn) throws MXException, java.rmi.RemoteException
fireEventsBeforeDB
in interface Transactable
txn
- TransactionMXException
- Error while committingjava.rmi.RemoteException
- Network errorpublic void fireEventsAfterDB(MXTransaction txn) throws MXException, java.rmi.RemoteException
fireEventsAfterDB
in interface Transactable
txn
- TransactionMXException
- Error while committingjava.rmi.RemoteException
- Network errorpublic void fireEventsAfterDBCommit(MXTransaction txn) throws MXException, java.rmi.RemoteException
fireEventsAfterDBCommit
in interface Transactable
txn
- TransactionMXException
- Error while committingjava.rmi.RemoteException
- Network errorpublic void put(java.lang.String keyString, boolean value) throws java.rmi.RemoteException
put
in interface MXTransaction
keyString
- value
- java.rmi.RemoteException
public void put(java.lang.String keyString, java.lang.String value) throws java.rmi.RemoteException
put
in interface MXTransaction
keyString
- value
- java.rmi.RemoteException
public boolean getBoolean(java.lang.String keyString) throws java.rmi.RemoteException
getBoolean
in interface MXTransaction
keyString
- java.rmi.RemoteException
public int getInt(java.lang.String keyString)
keyString
- public java.lang.String getString(java.lang.String keyString) throws java.rmi.RemoteException
getString
in interface MXTransaction
keyString
- java.rmi.RemoteException
public boolean remove(Transactable t) throws java.rmi.RemoteException
remove
in interface MXTransaction
t
- java.rmi.RemoteException
public long getTransactionStatus(Transactable t) throws MXException, java.rmi.RemoteException
MXTransaction
getTransactionStatus
in interface MXTransaction
MXException
- when the transactable doesn't exist in the transactionjava.rmi.RemoteException
public void clear() throws java.rmi.RemoteException
clear
in interface MXTransaction
java.rmi.RemoteException
public int indexOf(Transactable t) throws MXObjectNotFoundException, java.rmi.RemoteException
indexOf
in interface MXTransaction
MXObjectNotFoundException
- - if specified object not foundjava.rmi.RemoteException
- Network errorpublic void setIndexOf(Transactable tsb, int order) throws MXException, java.rmi.RemoteException
setIndexOf
in interface MXTransaction
tsb
- order
- MXException
java.rmi.RemoteException
public int getSize() throws java.rmi.RemoteException
getSize
in interface MXTransaction
java.rmi.RemoteException
public void setEventFired(boolean flag) throws java.rmi.RemoteException
setEventFired
in interface MXTransaction
flag
- java.rmi.RemoteException
public java.util.Map<java.lang.Object,java.lang.Object> getTxnPropertyMap(Transactable t) throws MXException, java.rmi.RemoteException
getTxnPropertyMap
in interface MXTransaction
Transactable
- MXException
java.rmi.RemoteException
public void setTxnPropertyMap(Transactable t, java.util.Map<java.lang.Object,java.lang.Object> map) throws MXException, java.rmi.RemoteException
setTxnPropertyMap
in interface MXTransaction
Transactable
- Map
- MXException
java.rmi.RemoteException
public void clearTxnPropertyMap() throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException