Interface InternalCacheValue<V>

All Known Implementing Classes:
ImmortalCacheValue, MetadataImmortalCacheValue, MetadataMortalCacheValue, MetadataTransientCacheValue, MetadataTransientMortalCacheValue, MortalCacheValue, TransientCacheValue, TransientMortalCacheValue

public interface InternalCacheValue<V>
A representation of an InternalCacheEntry that does not have a reference to the key. This should be used if the key is either not needed or available elsewhere as it is more efficient to marshall and unmarshall. Probably most useful in cache stores. Note that this should not be used to optimize memory overhead, since the saving of an additional reference to a key (a single object reference) does not warrant the cost of constructing an InternalCacheValue, where an existing InternalCacheEntry is already referenced. Use of this interface only makes sense when marshalling is involved, since the cost of marshalling the key again can be sidestepped using an InternalCacheValue if the key is already known/marshalled.
Since:
4.0
Author:
Manik Surtani
  • Method Details Link icon

    • getValue Link icon

      V getValue()
      Returns:
      the value represented by this internal wrapper
    • toInternalCacheEntry Link icon

      <K> InternalCacheEntry<K,V> toInternalCacheEntry(K key)
    • isExpired Link icon

      boolean isExpired(long now)
      Parameters:
      now - the current time as expressed by System.currentTimeMillis()
      Returns:
      true if the entry has expired; false otherwise
    • canExpire Link icon

      boolean canExpire()
      Returns:
      true if the entry can expire, false otherwise
    • isMaxIdleExpirable Link icon

      default boolean isMaxIdleExpirable()
      Returns:
      true if this entry can expire via max idle, false otherwise
    • getCreated Link icon

      long getCreated()
      Returns:
      timestamp when the entry was created
    • getLastUsed Link icon

      long getLastUsed()
      Returns:
      timestamp when the entry was last used
    • getLifespan Link icon

      long getLifespan()
      Returns:
      lifespan of the value
    • getMaxIdle Link icon

      long getMaxIdle()
      Returns:
      max idle time allowed
    • getExpiryTime Link icon

      long getExpiryTime()
    • getMetadata Link icon

      Metadata getMetadata()
    • getInternalMetadata Link icon

      PrivateMetadata getInternalMetadata()
    • setInternalMetadata Link icon

      void setInternalMetadata(PrivateMetadata internalMetadata)