java.lang.Object
com.hazelcast.hibernate.serialization.Expirable
- All Implemented Interfaces:
com.hazelcast.nio.serialization.DataSerializable,com.hazelcast.nio.serialization.IdentifiedDataSerializable
- Direct Known Subclasses:
ExpiryMarker,Value
public abstract class Expirable
extends Object
implements com.hazelcast.nio.serialization.IdentifiedDataSerializable
A container class which represents an entry in a region cache which can be marked for expiration
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanabstract ObjectgetValue()abstract ObjectgetValue(long txTimestamp) inthashCode()abstract booleanisReplaceableBy(long txTimestamp, Object newVersion, Comparator versionComparator) Determine if the current entry can be overridden with a value corresponding to the given new version and the transaction timestamp.abstract ExpiryMarkermarkForExpiration(long timeout, String nextMarkerId) Mark the entry for expiration with the given timeout and marker id.abstract booleanmatches(ExpiryMarker lock) voidreadData(com.hazelcast.nio.ObjectDataInput in) voidwriteData(com.hazelcast.nio.ObjectDataOutput out) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.hazelcast.nio.serialization.IdentifiedDataSerializable
getClassId, getFactoryId
-
Field Details
-
version
-
-
Constructor Details
-
Expirable
protected Expirable() -
Expirable
-
-
Method Details
-
isReplaceableBy
public abstract boolean isReplaceableBy(long txTimestamp, Object newVersion, Comparator versionComparator) Determine if the current entry can be overridden with a value corresponding to the given new version and the transaction timestamp.- Parameters:
txTimestamp- the timestamp of the transactionnewVersion- the new version for the replacement valueversionComparator- the comparator to use for the version- Returns:
trueif the value can be replaced,falseotherwise
-
getValue
- Returns:
- the value contained, or
nullif none exists
-
getValue
- Parameters:
txTimestamp- the timestamp of the transaction- Returns:
- the value contained if it was created before the transaction timestamp or
null
-
getVersion
- Returns:
- the version representing the value of
nullif the entry is not versioned
-
matches
- Returns:
trueif theExpirablematches using the specified lock,falseotherwise- See Also:
-
markForExpiration
Mark the entry for expiration with the given timeout and marker id. For every invocation a corresponding call toExpiryMarker.expire(long)should be made, provided that the returned markermatches(ExpiryMarker)- Parameters:
timeout- the timestamp in which the lock times outnextMarkerId- the next lock id to use if creating a new lock- Returns:
- the newly created marker, or the current marker with a higher multiplicity
- See Also:
-
writeData
- Specified by:
writeDatain interfacecom.hazelcast.nio.serialization.DataSerializable- Throws:
IOException
-
readData
- Specified by:
readDatain interfacecom.hazelcast.nio.serialization.DataSerializable- Throws:
IOException
-
equals
-
hashCode
public int hashCode()
-