Package net.sf.ehcache.transaction
Class SoftLockID
- java.lang.Object
-
- net.sf.ehcache.transaction.SoftLockID
-
- All Implemented Interfaces:
java.io.Serializable
public final class SoftLockID extends java.lang.Object implements java.io.SerializableA soft lock ID is used to uniquely identify a soft lock- Author:
- Ludovic Orban
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SoftLockID(TransactionID transactionID, java.lang.Object key, Element newElement, Element oldElement)Create a new SoftLockID instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object object)java.lang.ObjectgetKey()Get the key of the element this soft lock is guardingElementgetNewElement()Get the Element with which this soft lock should be replaced by on commit.ElementgetOldElement()Get the Element with which this soft lock should be replaced by on rollback.TransactionIDgetTransactionID()Get the ID of the transaction under which this soft lock is operatinginthashCode()java.lang.StringtoString()
-
-
-
Constructor Detail
-
SoftLockID
public SoftLockID(TransactionID transactionID, java.lang.Object key, Element newElement, Element oldElement)
Create a new SoftLockID instance- Parameters:
transactionID- the transaction IDkey- the element's key this soft lock is going to protectnewElement- the new element, can be nulloldElement- the old element, can be null
-
-
Method Detail
-
getTransactionID
public TransactionID getTransactionID()
Get the ID of the transaction under which this soft lock is operating- Returns:
- the TransactionID
-
getKey
public java.lang.Object getKey()
Get the key of the element this soft lock is guarding- Returns:
- the key
-
getNewElement
public Element getNewElement()
Get the Element with which this soft lock should be replaced by on commit.- Returns:
- the commit Element
-
getOldElement
public Element getOldElement()
Get the Element with which this soft lock should be replaced by on rollback.- Returns:
- the rollback Element
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-