org.apache.xmlgraphics.image.loader.cache
Class DefaultExpirationPolicy
java.lang.Object
org.apache.xmlgraphics.image.loader.cache.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 |
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 |
EXPIRATION_IMMEDIATE
public static final int EXPIRATION_IMMEDIATE
- See Also:
- Constant Field Values
EXPIRATION_NEVER
public static final int EXPIRATION_NEVER
- See Also:
- Constant Field Values
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)
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 stampstimestamp
- the creation time stamp (the semantics of
System.currentTimeMillis()
apply)
- Returns:
- true if the entry is to be considered expired, false if not
Copyright 1999-2010 The Apache Software Foundation. All Rights Reserved.