EclipseLink 2.2.0, build 'v20110202-r8913' API Reference

org.eclipse.persistence.descriptors.invalidation
Class DailyCacheInvalidationPolicy

java.lang.Object
  extended by org.eclipse.persistence.descriptors.invalidation.CacheInvalidationPolicy
      extended by org.eclipse.persistence.descriptors.invalidation.DailyCacheInvalidationPolicy
All Implemented Interfaces:
java.io.Serializable

public class DailyCacheInvalidationPolicy
extends CacheInvalidationPolicy

PUBLIC: A CacheInvalidationPolicy that allows objects to expire every day at a specific time. A daily cache invalidation policy is created with an hour, minute, second and millisecond when objects will expire. Objects will expire in the cache every day at that time.

See Also:
CacheInvalidationPolicy, Serialized Form

Field Summary
protected  java.util.Calendar expiryTime
           
protected  java.util.Calendar previousExpiry
           
 
Fields inherited from class org.eclipse.persistence.descriptors.invalidation.CacheInvalidationPolicy
isInvalidationRandomized, NO_EXPIRY, random, shouldRefreshInvalidObjectsOnClone, shouldUpdateReadTimeOnUpdate
 
Constructor Summary
DailyCacheInvalidationPolicy()
          INTERNAL: Default constructor for Project XML if setters are not called to set expiry times, expiry time will be the time of day at which this object is instantiated.
DailyCacheInvalidationPolicy(int hour, int minute, int second, int millisecond)
          PUBLIC: Construct a daily policy that will allow objects to expire at a specific time of day.
 
Method Summary
 java.util.Calendar getExpiryTime()
          INTERNAL: Get the expiry time as a Calendar.
 long getExpiryTimeInMillis(org.eclipse.persistence.internal.identitymaps.CacheKey key)
          INTERNAL: Return the next expiry time.
 void incrementExpiry()
          INTERNAL: Update the expiry time to be the day after the current day.
 boolean isInvalidated(org.eclipse.persistence.internal.identitymaps.CacheKey key, long currentTimeMillis)
          INTERNAL: Return true if this object has expire or is invalid
 void setExpiryTime(java.util.Calendar calendar)
          INTERNAL: Set the expiry time based on a Calendar.
 void setExpiryTime(int hour, int minute, int second, int millisecond)
          PUBLIC: Set a new expiry time for this object Provide the hour, minute, second and millisecond.
 
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

expiryTime

protected java.util.Calendar expiryTime

previousExpiry

protected java.util.Calendar previousExpiry
Constructor Detail

DailyCacheInvalidationPolicy

public DailyCacheInvalidationPolicy()
INTERNAL: Default constructor for Project XML if setters are not called to set expiry times, expiry time will be the time of day at which this object is instantiated.


DailyCacheInvalidationPolicy

public DailyCacheInvalidationPolicy(int hour,
                                    int minute,
                                    int second,
                                    int millisecond)
PUBLIC: Construct a daily policy that will allow objects to expire at a specific time of day. Provide the hour, minute, second and millisecond. Objects that make use of this policy will be set to expire at that exact time every day.

Method Detail

getExpiryTimeInMillis

public long getExpiryTimeInMillis(org.eclipse.persistence.internal.identitymaps.CacheKey key)
INTERNAL: Return the next expiry time.

Specified by:
getExpiryTimeInMillis in class CacheInvalidationPolicy

getExpiryTime

public java.util.Calendar getExpiryTime()
INTERNAL: Get the expiry time as a Calendar. Used for setting the expiry time in deployment XML


isInvalidated

public boolean isInvalidated(org.eclipse.persistence.internal.identitymaps.CacheKey key,
                             long currentTimeMillis)
INTERNAL: Return true if this object has expire or is invalid

Specified by:
isInvalidated in class CacheInvalidationPolicy

incrementExpiry

public void incrementExpiry()
INTERNAL: Update the expiry time to be the day after the current day.


setExpiryTime

public void setExpiryTime(int hour,
                          int minute,
                          int second,
                          int millisecond)
PUBLIC: Set a new expiry time for this object Provide the hour, minute, second and millisecond. Objects which make use of this policy will be set to expire at that exact time every day.


setExpiryTime

public void setExpiryTime(java.util.Calendar calendar)
INTERNAL: Set the expiry time based on a Calendar. Used for setting the expiry time from deployment XML.


EclipseLink 2.2.0, build 'v20110202-r8913' API Reference