org.infinispan.container.entries
Interface InternalCacheValue

All Known Implementing Classes:
ImmortalCacheValue, MortalCacheValue, TransientCacheValue, TransientMortalCacheValue

public interface InternalCacheValue

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 Summary
 boolean canExpire()
           
 long getCreated()
           
 long getLastUsed()
           
 long getLifespan()
           
 long getMaxIdle()
           
 Object getValue()
           
 boolean isExpired()
           
 InternalCacheEntry toInternalCacheEntry(Object key)
           
 

Method Detail

getValue

Object getValue()
Returns:
the value represented by this internal wrapper

toInternalCacheEntry

InternalCacheEntry toInternalCacheEntry(Object key)

isExpired

boolean isExpired()
Returns:
true if the entry has expired; false otherwise

canExpire

boolean canExpire()
Returns:
true if the entry can expire, false otherwise

getCreated

long getCreated()
Returns:
timestamp when the entry was created

getLastUsed

long getLastUsed()
Returns:
timestamp when the entry was last used

getLifespan

long getLifespan()
Returns:
lifespan of the value

getMaxIdle

long getMaxIdle()
Returns:
max idle time allowed

Google Analytics

Copyright © 2010 JBoss, a division of Red Hat. All Rights Reserved.