public abstract class CacheInvalidationPolicy
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
protected boolean |
isInvalidationRandomized
Allows the timeToLive to be randomized to avoid bottlenecks.
|
static long |
NO_EXPIRY |
protected java.util.Random |
random
Random used for randomized invalidation.
|
protected boolean |
shouldRefreshInvalidObjectsOnClone
Determines if expired object registered in the unit of work should be refreshed, default true.
|
protected boolean |
shouldUpdateReadTimeOnUpdate
This will represent objects that do not expire.
|
Constructor and Description |
---|
CacheInvalidationPolicy() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
abstract long |
getExpiryTimeInMillis(org.eclipse.persistence.internal.identitymaps.CacheKey key)
INTERNAL:
Get the next time when this object will become invalid
|
long |
getRemainingValidTime(org.eclipse.persistence.internal.identitymaps.CacheKey key)
INTERNAL:
Return the remaining life of this object
|
void |
initialize(ClassDescriptor descriptor,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Allow initialization with the descriptor.
|
boolean |
isInvalidated(org.eclipse.persistence.internal.identitymaps.CacheKey key)
INTERNAL:
return true if this object is expire, false otherwise.
|
abstract boolean |
isInvalidated(org.eclipse.persistence.internal.identitymaps.CacheKey key,
long currentTimeMillis)
INTERNAL:
return true if this object is expire, false otherwise.
|
boolean |
isInvalidationRandomized()
PUBLIC:
Allows the timeToLive to be randomized to avoid bottlenecks.
|
void |
setIsInvalidationRandomized(boolean isInvalidationRandomized)
PUBLIC:
Allows the timeToLive to be randomized to avoid bottlenecks.
|
void |
setShouldRefreshInvalidObjectsInUnitOfWork(boolean shouldRefreshInvalidObjectsInUnitOfWork)
Deprecated.
since EclipseLink 2.2
|
void |
setShouldRefreshInvalidObjectsOnClone(boolean shouldRefreshInvalidObjectsOnClone)
PUBLIC:
Set if expired object should be refreshed prior to cloning, default is true.
|
void |
setShouldUpdateReadTimeOnUpdate(boolean shouldUpdateReadTime)
PUBLIC:
Set whether to update the stored time an object was read when an object is updated.
|
boolean |
shouldRefreshInvalidObjectsInUnitOfWork()
Deprecated.
since EclipseLink 2.2
|
boolean |
shouldRefreshInvalidObjectsOnClone()
PUBLIC:
Return if expired object should be refreshed prior to cloning.
|
boolean |
shouldUpdateReadTimeOnUpdate()
PUBLIC:
Return whether objects affected by this CacheInvalidationPolicy should have
the read time on their cache keys updated when an update occurs.
|
public static final long NO_EXPIRY
protected boolean shouldUpdateReadTimeOnUpdate
protected boolean shouldRefreshInvalidObjectsOnClone
protected boolean isInvalidationRandomized
protected java.util.Random random
public boolean isInvalidationRandomized()
public void setIsInvalidationRandomized(boolean isInvalidationRandomized)
public abstract long getExpiryTimeInMillis(org.eclipse.persistence.internal.identitymaps.CacheKey key)
public long getRemainingValidTime(org.eclipse.persistence.internal.identitymaps.CacheKey key)
public void initialize(ClassDescriptor descriptor, org.eclipse.persistence.internal.sessions.AbstractSession session)
public boolean isInvalidated(org.eclipse.persistence.internal.identitymaps.CacheKey key)
public abstract boolean isInvalidated(org.eclipse.persistence.internal.identitymaps.CacheKey key, long currentTimeMillis)
public void setShouldUpdateReadTimeOnUpdate(boolean shouldUpdateReadTime)
public boolean shouldUpdateReadTimeOnUpdate()
@Deprecated public void setShouldRefreshInvalidObjectsInUnitOfWork(boolean shouldRefreshInvalidObjectsInUnitOfWork)
public void setShouldRefreshInvalidObjectsOnClone(boolean shouldRefreshInvalidObjectsOnClone)
@Deprecated public boolean shouldRefreshInvalidObjectsInUnitOfWork()
shouldRefreshInvalidObjectsOnClone()
public boolean shouldRefreshInvalidObjectsOnClone()
public java.lang.Object clone()
clone
in class java.lang.Object