Class DefaultExpirationPolicy

  • All Implemented Interfaces:
    ExpirationPolicy

    public class DefaultExpirationPolicy
    extends java.lang.Object
    implements ExpirationPolicy
    Implements the default expiration policy for the image cache.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isExpired​(org.apache.xmlgraphics.image.loader.cache.TimeStampProvider provider, long timestamp)
      Indicates whether a cache entry is expired given its creation time stamp.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultExpirationPolicy

        public DefaultExpirationPolicy()
        Creates a new policy with default settings (expiration in 60 seconds).
      • DefaultExpirationPolicy

        public DefaultExpirationPolicy​(int expirationAfter)
        Creates a new policy.
        Parameters:
        expirationAfter - the expiration in seconds (a negative value means: never expire)
    • Method Detail

      • isExpired

        public boolean isExpired​(org.apache.xmlgraphics.image.loader.cache.TimeStampProvider provider,
                                 long timestamp)
        Indicates whether a cache entry is expired given its creation time stamp.
        Specified by:
        isExpired in interface ExpirationPolicy
        Parameters:
        provider - the provider for new time stamps
        timestamp - the creation time stamp (the semantics of System.currentTimeMillis() apply)
        Returns:
        true if the entry is to be considered expired, false if not