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 long
The serialVersionUID required forSerializable
. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
static Factory
<ExpiryPolicy> Obtains aFactory
for an EternalExpiryPolicy
.Gets theDuration
before an accessed Cache.Entry is considered expired.Gets theDuration
before a newly created Cache.Entry is considered expired.Gets theDuration
before an updated Cache.Entry is considered expired.int
hashCode()
-
Field Details
-
serialVersionUID
public static final long serialVersionUIDThe serialVersionUID required forSerializable
.- See Also:
-
-
Constructor Details
-
EternalExpiryPolicy
public EternalExpiryPolicy()
-
-
Method Details
-
factoryOf
Obtains aFactory
for an EternalExpiryPolicy
.- Returns:
- a
Factory
for an EternalExpiryPolicy
.
-
getExpiryForCreation
Gets theDuration
before 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
Duration
before an entry expires. If aDuration.ZERO
is 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
Duration
will be used.- Specified by:
getExpiryForCreation
in interfaceExpiryPolicy
- Returns:
- the new
Duration
before a created entry expires
-
getExpiryForAccess
Gets theDuration
before an accessed Cache.Entry is considered expired.This method is called by a caching implementation after a Cache.Entry is accessed to determine the
Duration
before an entry expires. If aDuration.ZERO
is returned a Cache.Entry will be considered immediately expired. Returningnull
will 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:
getExpiryForAccess
in interfaceExpiryPolicy
- Returns:
- the new
Duration
before an accessed entry expires
-
getExpiryForUpdate
Gets theDuration
before an updated Cache.Entry is considered expired.This method is called by the caching implementation after a Cache.Entry is updated to determine the
Duration
before the updated entry expires. If aDuration.ZERO
is returned a Cache.Entry is considered immediately expired. Returningnull
will 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:
getExpiryForUpdate
in interfaceExpiryPolicy
- Returns:
- the new
Duration
before an updated entry expires
-
hashCode
public int hashCode() -
equals
-