public class TimeToLiveCacheInvalidationPolicy extends CacheInvalidationPolicy
CacheInvalidationPolicy
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected long |
timeToLive
Number of milliseconds before invalidation.
|
isInvalidationRandomized, NO_EXPIRY, random, shouldRefreshInvalidObjectsOnClone, shouldUpdateReadTimeOnUpdate
Constructor and Description |
---|
TimeToLiveCacheInvalidationPolicy()
INTERNAL:
Default Constructor for Project XML
Unless the timeToLive is set by method, objects will expire immediately
|
TimeToLiveCacheInvalidationPolicy(long timeToLive)
PUBLIC:
Construct a TimeToLiveCacheInvalidationPolicy
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
long |
getExpiryTimeInMillis(org.eclipse.persistence.internal.identitymaps.CacheKey key)
INTERNAL:
Return the next expiry time.
|
long |
getTimeToLive()
PUBLIC:
Return the time-to-live specified for this policy.
|
boolean |
isInvalidated(org.eclipse.persistence.internal.identitymaps.CacheKey key,
long currentTimeMillis)
INTERNAL:
Return true if this object is set as invalid or has expired.
|
void |
setTimeToLive(long timeToLive)
PUBLIC:
Set the time-to-live specified by this policy.
|
getRemainingValidTime, initialize, isInvalidated, isInvalidationRandomized, setIsInvalidationRandomized, setShouldRefreshInvalidObjectsInUnitOfWork, setShouldRefreshInvalidObjectsOnClone, setShouldUpdateReadTimeOnUpdate, shouldRefreshInvalidObjectsInUnitOfWork, shouldRefreshInvalidObjectsOnClone, shouldUpdateReadTimeOnUpdate
public TimeToLiveCacheInvalidationPolicy()
public TimeToLiveCacheInvalidationPolicy(long timeToLive)
timeToLive
- the number of milliseconds an object affected by this policy will live.public long getExpiryTimeInMillis(org.eclipse.persistence.internal.identitymaps.CacheKey key)
getExpiryTimeInMillis
in class CacheInvalidationPolicy
public long getTimeToLive()
public boolean isInvalidated(org.eclipse.persistence.internal.identitymaps.CacheKey key, long currentTimeMillis)
isInvalidated
in class CacheInvalidationPolicy
public void setTimeToLive(long timeToLive)
public java.lang.Object clone()
clone
in class CacheInvalidationPolicy