Class EternalExpiryPolicy
- All Implemented Interfaces:
Serializable, ExpiryPolicy
ExpiryPolicy specifies 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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longThe serialVersionUID required forSerializable. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic Factory<ExpiryPolicy> Obtains aFactoryfor an EternalExpiryPolicy.Gets theDurationbefore an accessed Cache.Entry is considered expired.Gets theDurationbefore a newly created Cache.Entry is considered expired.Gets theDurationbefore an updated Cache.Entry is considered expired.inthashCode()
-
Field Details
-
serialVersionUID
-
-
Constructor Details
-
EternalExpiryPolicy
public EternalExpiryPolicy()
-
-
Method Details
-
factoryOf
Obtains aFactoryfor an EternalExpiryPolicy.- Returns:
- a
Factoryfor an EternalExpiryPolicy.
-
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
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
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
-
equals
-