Package com.arbortext.e3
Interface E3CacheEntry
public interface E3CacheEntry
Describes an entry in a cache.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intIndicates that the response corresponding to a request is not in the cache, but that the response should be placed there for use later.static final intIndicates that the response corresponding to a request is in the cache and can be returned to the user immediately.static final intIndicates that the response corresponding to a request is not in the cache and that the response should not be placed in the cache after E3 computes it. -
Method Summary
Modifier and TypeMethodDescriptionReturns the response object that should be transmitted to the client.intIndicates whether this entry is not cacheable, or cacheable but not currently in the cache, or in the cachebooleanisLocked()Indicates whether the response is locked.voidunlock()Unlocks the entry.
-
Field Details
-
NOT_CACHEABLE
static final int NOT_CACHEABLEIndicates that the response corresponding to a request is not in the cache and that the response should not be placed in the cache after E3 computes it.- See Also:
-
CACHEABLE
static final int CACHEABLEIndicates that the response corresponding to a request is not in the cache, but that the response should be placed there for use later.- See Also:
-
IN_CACHE
static final int IN_CACHEIndicates that the response corresponding to a request is in the cache and can be returned to the user immediately.- See Also:
-
-
Method Details
-
getResponse
Returns the response object that should be transmitted to the client.- Returns:
- response object
- Throws:
IllegalStateException- unless status is IN_CACHE and the response is locked
-
getStatus
int getStatus()Indicates whether this entry is not cacheable, or cacheable but not currently in the cache, or in the cache- Returns:
- NOT_CACHEABLE, CACHEABLE, or IN_CACHE
-
isLocked
boolean isLocked()Indicates whether the response is locked. If not, it's not safe to return it to the client or do much else with it, because it might be deleted at any time.- Returns:
Trueif the entry is locked,Falseotherwise
-
unlock
Unlocks the entry. The cache is free to delete it.- Throws:
IllegalStateException- unless the status is IN_CACHE and the entry is locked.
-