Interface E3CacheEntry


public interface E3CacheEntry
Describes an entry in a cache.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Indicates 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 int
    Indicates that the response corresponding to a request is in the cache and can be returned to the user immediately.
    static final int
    Indicates 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 Type
    Method
    Description
    Returns the response object that should be transmitted to the client.
    int
    Indicates whether this entry is not cacheable, or cacheable but not currently in the cache, or in the cache
    boolean
    Indicates whether the response is locked.
    void
    Unlocks the entry.
  • Field Details

    • NOT_CACHEABLE

      static final int NOT_CACHEABLE
      Indicates 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 CACHEABLE
      Indicates 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_CACHE
      Indicates 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:
      True if the entry is locked, False otherwise
    • unlock

      void unlock() throws IllegalStateException
      Unlocks the entry. The cache is free to delete it.
      Throws:
      IllegalStateException - unless the status is IN_CACHE and the entry is locked.