Package org.iplass.mtp.transaction
Class NoTransaction
- java.lang.Object
-
- org.iplass.mtp.transaction.NoTransaction
-
- All Implemented Interfaces:
Transaction
final class NoTransaction extends java.lang.Object implements Transaction
トランザクションがない状態を表すTransactionです。
-
-
Field Summary
-
Fields inherited from interface org.iplass.mtp.transaction.Transaction
NO_TRANSACTION
-
-
Constructor Summary
Constructors Constructor Description NoTransaction()
-
Method Summary
Modifier and Type Method Description voidaddTransactionListener(TransactionListener listener)このトランザクションのcommit、rollbackを監視するリスナーを登録します。voidcommit()トランザクションをコミットします。booleanequals(java.lang.Object obj)java.lang.ObjectgetAttribute(java.lang.Object key)このトランザクションコンテキストに紐づけられている特定の属性を取得します。 同一トランザクション内でsetAttribute()したものがあれば、その値が取得できます。TransactionStatusgetStatus()トランザクションの状態を取得します。inthashCode()booleanisReadOnly()このトランザクションがReadOnlyとしてマークされているかどうかを取得します。booleanisRollbackOnly()このトランザクションがsetRollbackOnlyされているかどうかを取得します。java.lang.ObjectremoveAttribute(java.lang.Object key)このトランザクションコンテキストに紐づけられている特定の属性を削除します。voidrollback()トランザクションをロールバックします。voidsetAttribute(java.lang.Object key, java.lang.Object value)このトランザクションのコンテキストに特定の属性を紐づけます。voidsetRollbackOnly()このトランザクションをロールバックするものとしてマークします。 setRollbackOnlyされたトランザクションは最終的にはロールバックされます。-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.iplass.mtp.transaction.Transaction
afterCommit, afterRollback
-
-
-
-
Method Detail
-
commit
public void commit()
Description copied from interface:Transactionトランザクションをコミットします。- Specified by:
commitin interfaceTransaction
-
rollback
public void rollback()
Description copied from interface:Transactionトランザクションをロールバックします。- Specified by:
rollbackin interfaceTransaction
-
setRollbackOnly
public void setRollbackOnly()
Description copied from interface:Transactionこのトランザクションをロールバックするものとしてマークします。 setRollbackOnlyされたトランザクションは最終的にはロールバックされます。- Specified by:
setRollbackOnlyin interfaceTransaction
-
isRollbackOnly
public boolean isRollbackOnly()
Description copied from interface:TransactionこのトランザクションがsetRollbackOnlyされているかどうかを取得します。- Specified by:
isRollbackOnlyin interfaceTransaction- Returns:
- setRollbackOnlyの場合true
-
isReadOnly
public boolean isReadOnly()
Description copied from interface:TransactionこのトランザクションがReadOnlyとしてマークされているかどうかを取得します。- Specified by:
isReadOnlyin interfaceTransaction- Returns:
-
getStatus
public TransactionStatus getStatus()
Description copied from interface:Transactionトランザクションの状態を取得します。- Specified by:
getStatusin interfaceTransaction- Returns:
-
setAttribute
public void setAttribute(java.lang.Object key, java.lang.Object value)Description copied from interface:Transactionこのトランザクションのコンテキストに特定の属性を紐づけます。- Specified by:
setAttributein interfaceTransaction- Parameters:
key- 属性のキーvalue- 属性の値
-
getAttribute
public java.lang.Object getAttribute(java.lang.Object key)
Description copied from interface:Transactionこのトランザクションコンテキストに紐づけられている特定の属性を取得します。 同一トランザクション内でsetAttribute()したものがあれば、その値が取得できます。- Specified by:
getAttributein interfaceTransaction- Parameters:
key- 属性のキー- Returns:
- 属性の値
-
removeAttribute
public java.lang.Object removeAttribute(java.lang.Object key)
Description copied from interface:Transactionこのトランザクションコンテキストに紐づけられている特定の属性を削除します。- Specified by:
removeAttributein interfaceTransaction- Parameters:
key- 属性のキー- Returns:
- 削除された値
-
addTransactionListener
public void addTransactionListener(TransactionListener listener)
Description copied from interface:Transactionこのトランザクションのcommit、rollbackを監視するリスナーを登録します。- Specified by:
addTransactionListenerin interfaceTransaction
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-