Class EternalExpiryPolicy
- java.lang.Object
-
- javax.cache.expiry.EternalExpiryPolicy
-
- All Implemented Interfaces:
java.io.Serializable,ExpiryPolicy
public final class EternalExpiryPolicy extends java.lang.Object implements ExpiryPolicy, java.io.Serializable
An eternalExpiryPolicyspecifies that Cache Entries won't expire. This however doesn't mean they won't be evicted if an underlying implementation needs to free-up resources where by it may choose to evict entries that are not due to expire.- Since:
- 1.0
- See Also:
ExpiryPolicy, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static longserialVersionUIDThe serialVersionUID required forSerializable.
-
Constructor Summary
Constructors Constructor Description EternalExpiryPolicy()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)static Factory<ExpiryPolicy>factoryOf()Obtains aFactoryfor an EternalExpiryPolicy.DurationgetExpiryForAccess()Gets theDurationbefore an accessed Cache.Entry is considered expired.DurationgetExpiryForCreation()Gets theDurationbefore a newly created Cache.Entry is considered expired.DurationgetExpiryForUpdate()Gets theDurationbefore an updated Cache.Entry is considered expired.inthashCode()
-
-
-
Field Detail
-
serialVersionUID
public static final long serialVersionUID
The serialVersionUID required forSerializable.- See Also:
- Constant Field Values
-
-
Method Detail
-
factoryOf
public static Factory<ExpiryPolicy> factoryOf()
Obtains aFactoryfor an EternalExpiryPolicy.- Returns:
- a
Factoryfor an EternalExpiryPolicy.
-
getExpiryForCreation
public Duration getExpiryForCreation()
Gets theDurationbefore a newly created Cache.Entry is considered expired.This method is called by a caching implementation after a Cache.Entry is created, but before a Cache.Entry is added to a cache, to determine the
Durationbefore an entry expires. If aDuration.ZEROis returned the new Cache.Entry is considered to be already expired and will not be added to the Cache.Should an exception occur while determining the Duration, an implementation specific default
Durationwill be used.- Specified by:
getExpiryForCreationin interfaceExpiryPolicy- Returns:
- the new
Durationbefore a created entry expires
-
getExpiryForAccess
public Duration getExpiryForAccess()
Gets theDurationbefore an accessed Cache.Entry is considered expired.This method is called by a caching implementation after a Cache.Entry is accessed to determine the
Durationbefore an entry expires. If aDuration.ZEROis returned a Cache.Entry will be considered immediately expired. Returningnullwill result in no change to the previously understood expiryDuration.Should an exception occur while determining the Duration, an implementation specific default Duration will be used.
- Specified by:
getExpiryForAccessin interfaceExpiryPolicy- Returns:
- the new
Durationbefore an accessed entry expires
-
getExpiryForUpdate
public Duration getExpiryForUpdate()
Gets theDurationbefore an updated Cache.Entry is considered expired.This method is called by the caching implementation after a Cache.Entry is updated to determine the
Durationbefore the updated entry expires. If aDuration.ZEROis returned a Cache.Entry is considered immediately expired. Returningnullwill result in no change to the previously understood expiryDuration.Should an exception occur while determining the Duration, an implementation specific default Duration will be used.
- Specified by:
getExpiryForUpdatein interfaceExpiryPolicy- Returns:
- the new
Durationbefore an updated entry expires
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
-