|
EclipseLink 2.3.2, build 'v20111125-r10461' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.persistence.descriptors.invalidation.CacheInvalidationPolicy org.eclipse.persistence.descriptors.invalidation.TimeToLiveCacheInvalidationPolicy
public class TimeToLiveCacheInvalidationPolicy
PUBLIC: A CacheInvalidationPolicy which allows objects to live for a specific amount of time after they are read. A TimeToLiveCacheInvalidationPolicy is instantiated with a specific number of milliseconds. This represents how long after an object is read it will expire.
CacheInvalidationPolicy
,
Serialized FormField Summary | |
---|---|
protected long |
timeToLive
Number of milliseconds before invalidation. |
Fields inherited from class org.eclipse.persistence.descriptors.invalidation.CacheInvalidationPolicy |
---|
isInvalidationRandomized, NO_EXPIRY, random, shouldRefreshInvalidObjectsOnClone, shouldUpdateReadTimeOnUpdate |
Constructor Summary | |
---|---|
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 |
Method Summary | |
---|---|
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. |
Methods inherited from class org.eclipse.persistence.descriptors.invalidation.CacheInvalidationPolicy |
---|
getRemainingValidTime, isInvalidated, isInvalidationRandomized, setIsInvalidationRandomized, setShouldRefreshInvalidObjectsInUnitOfWork, setShouldRefreshInvalidObjectsOnClone, setShouldUpdateReadTimeOnUpdate, shouldRefreshInvalidObjectsInUnitOfWork, shouldRefreshInvalidObjectsOnClone, shouldUpdateReadTimeOnUpdate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected long timeToLive
Constructor Detail |
---|
public TimeToLiveCacheInvalidationPolicy()
public TimeToLiveCacheInvalidationPolicy(long timeToLive)
timeToLive
- the number of milliseconds an object affected by this policy will live.Method Detail |
---|
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)
|
EclipseLink 2.3.2, build 'v20111125-r10461' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |