com.servingxml.io.cache
Interface Expirable

All Known Implementing Classes:
ExpirableFamily, SlidingExpirable, StreamExpirable, XsltExpirable

public interface Expirable

Defines an interface for a expirable.

The XXXExpirable family (DynamicChangeable, StreamExpirable, etc.) provide an interface for last modified which is appropriate for a specific kind of resource (dynamic, system, etc.). Implementations of Expirable will adapt the specialized XXXExpirable last modified interface to the common Expirable last modified interface.


Field Summary
static Expirable IMMEDIATE_EXPIRY
          A Expirable object whose hasExpired method always returns true.
static Expirable NEVER_EXPIRES
          A Expirable object whose hasExpired method always returns false.
 
Method Summary
 long getLastModified(long timestamp)
          Returns the last modified date.
 boolean hasExpired(long timestamp)
          Called by the cache manager when it is processing a validation event that this resource state can receive.
 boolean immediateExpiry()
           
 

Field Detail

IMMEDIATE_EXPIRY

static final Expirable IMMEDIATE_EXPIRY
A Expirable object whose hasExpired method always returns true.


NEVER_EXPIRES

static final Expirable NEVER_EXPIRES
A Expirable object whose hasExpired method always returns false.

Method Detail

getLastModified

long getLastModified(long timestamp)
Returns the last modified date.

A concrete subclass must provide an implementation of this method to indicate whether the cached resource has changed. It may be called often, so it should execute quickly.


hasExpired

boolean hasExpired(long timestamp)
Called by the cache manager when it is processing a validation event that this resource state can receive.

A concrete subclass must provide an implementation of this method to indicate whether the cached resource has expired. It may be called often, so it should execute quickly.


immediateExpiry

boolean immediateExpiry()