org.infinispan.container.entries
Class TransientMortalCacheValue

java.lang.Object
  extended by org.infinispan.container.entries.ImmortalCacheValue
      extended by org.infinispan.container.entries.MortalCacheValue
          extended by org.infinispan.container.entries.TransientMortalCacheValue
All Implemented Interfaces:
Cloneable, InternalCacheValue
Direct Known Subclasses:
VersionedTransientMortalCacheValue

public class TransientMortalCacheValue
extends MortalCacheValue

A transient, mortal cache value to correspond with TransientMortalCacheEntry

Since:
4.0
Author:
Manik Surtani

Nested Class Summary
static class TransientMortalCacheValue.Externalizer
           
 
Field Summary
protected  long lastUsed
           
protected  long maxIdle
           
 
Fields inherited from class org.infinispan.container.entries.MortalCacheValue
created, lifespan
 
Fields inherited from class org.infinispan.container.entries.ImmortalCacheValue
value
 
Constructor Summary
TransientMortalCacheValue(Object value, long created)
           
TransientMortalCacheValue(Object value, long created, long lifespan, long maxIdle)
           
TransientMortalCacheValue(Object value, long created, long lifespan, long maxIdle, long lastUsed)
           
 
Method Summary
 TransientMortalCacheValue clone()
           
 boolean equals(Object o)
           
 long getLastUsed()
           
 long getMaxIdle()
           
 int hashCode()
           
 boolean isExpired()
           
 boolean isExpired(long now)
           
 void setLastUsed(long lastUsed)
           
 void setMaxIdle(long maxIdle)
           
 InternalCacheEntry toInternalCacheEntry(Object key)
           
 String toString()
           
 
Methods inherited from class org.infinispan.container.entries.MortalCacheValue
canExpire, getCreated, getLifespan, setCreated, setLifespan
 
Methods inherited from class org.infinispan.container.entries.ImmortalCacheValue
getValue, setValue
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

maxIdle

protected long maxIdle

lastUsed

protected long lastUsed
Constructor Detail

TransientMortalCacheValue

public TransientMortalCacheValue(Object value,
                                 long created,
                                 long lifespan,
                                 long maxIdle,
                                 long lastUsed)

TransientMortalCacheValue

public TransientMortalCacheValue(Object value,
                                 long created,
                                 long lifespan,
                                 long maxIdle)

TransientMortalCacheValue

public TransientMortalCacheValue(Object value,
                                 long created)
Method Detail

getMaxIdle

public long getMaxIdle()
Specified by:
getMaxIdle in interface InternalCacheValue
Overrides:
getMaxIdle in class ImmortalCacheValue
Returns:
max idle time allowed

setMaxIdle

public void setMaxIdle(long maxIdle)

getLastUsed

public long getLastUsed()
Specified by:
getLastUsed in interface InternalCacheValue
Overrides:
getLastUsed in class ImmortalCacheValue
Returns:
timestamp when the entry was last used

setLastUsed

public void setLastUsed(long lastUsed)

isExpired

public boolean isExpired(long now)
Specified by:
isExpired in interface InternalCacheValue
Overrides:
isExpired in class MortalCacheValue
Parameters:
now - the current time as expressed by System.currentTimeMillis()
Returns:
true if the entry has expired; false otherwise

isExpired

public boolean isExpired()
Specified by:
isExpired in interface InternalCacheValue
Overrides:
isExpired in class MortalCacheValue
Returns:
true if the entry has expired; false otherwise

toInternalCacheEntry

public InternalCacheEntry toInternalCacheEntry(Object key)
Specified by:
toInternalCacheEntry in interface InternalCacheValue
Overrides:
toInternalCacheEntry in class MortalCacheValue

equals

public boolean equals(Object o)
Overrides:
equals in class MortalCacheValue

hashCode

public int hashCode()
Overrides:
hashCode in class MortalCacheValue

toString

public String toString()
Overrides:
toString in class MortalCacheValue

clone

public TransientMortalCacheValue clone()
Overrides:
clone in class MortalCacheValue

-->

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