Class DefaultExpirationPolicy
java.lang.Object
org.apache.xmlgraphics.image.loader.cache.DefaultExpirationPolicy
- All Implemented Interfaces:
ExpirationPolicy
Implements the default expiration policy for the image cache.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new policy with default settings (expiration in 60 seconds).DefaultExpirationPolicy
(int expirationAfter) Creates a new policy. -
Method Summary
Modifier and TypeMethodDescriptionboolean
isExpired
(org.apache.xmlgraphics.image.loader.cache.TimeStampProvider provider, long timestamp) Indicates whether a cache entry is expired given its creation time stamp.
-
Field Details
-
EXPIRATION_IMMEDIATE
public static final int EXPIRATION_IMMEDIATE- See Also:
-
EXPIRATION_NEVER
public static final int EXPIRATION_NEVER- See Also:
-
-
Constructor Details
-
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 Details
-
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 interfaceExpirationPolicy
- Parameters:
provider
- the provider for new time stampstimestamp
- the creation time stamp (the semantics ofSystem.currentTimeMillis()
apply)- Returns:
- true if the entry is to be considered expired, false if not
-