public abstract class AbstractBackingCacheEntry<K extends Serializable,V extends Cacheable<K>> extends Object implements BackingCacheEntry<K,V>
BackingCacheEntry
implementations.Constructor and Description |
---|
AbstractBackingCacheEntry() |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(BackingCacheEntry<K,V> entry) |
boolean |
equals(Object object) |
long |
getLastUsed()
Gets the timestamp of the last time this entry was in use.
|
int |
hashCode() |
void |
invalidate()
Causes
BackingCacheEntry.isValid() to hereafter return true . |
boolean |
isInUse()
Gets whether this entry is in use by a caller.
|
boolean |
isPrePassivated()
Gets whether the entry can be passivated without invoking any callbacks on the underlying item.
|
boolean |
isValid()
Whether this entry has been invalidated (in which case it should be reacquired).
|
void |
setInUse(boolean inUse)
Sets whether this entry is in use by a caller.
|
void |
setLastUsed(long lastUsed)
Exposed as public only as an aid to unit tests.
|
void |
setPrePassivated(boolean prePassivated)
Sets whether the entry can be passivated without invoking any callbacks on the underlying item.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getUnderlyingItem, lock, tryLock, unlock
isModified
getId
public long getLastUsed()
BackingCacheEntry
getLastUsed
in interface BackingCacheEntry<K extends Serializable,V extends Cacheable<K>>
public boolean isInUse()
BackingCacheEntry
isInUse
in interface BackingCacheEntry<K extends Serializable,V extends Cacheable<K>>
public void setInUse(boolean inUse)
BackingCacheEntry
setInUse
in interface BackingCacheEntry<K extends Serializable,V extends Cacheable<K>>
public void setLastUsed(long lastUsed)
lastUsed
- time since epoch when last usedpublic boolean isPrePassivated()
BackingCacheEntry
isPrePassivated
in interface BackingCacheEntry<K extends Serializable,V extends Cacheable<K>>
public void setPrePassivated(boolean prePassivated)
BackingCacheEntry
setPrePassivated
in interface BackingCacheEntry<K extends Serializable,V extends Cacheable<K>>
public void invalidate()
BackingCacheEntry
BackingCacheEntry.isValid()
to hereafter return true
.
NOTE: This method should only be called with the lock held.
invalidate
in interface BackingCacheEntry<K extends Serializable,V extends Cacheable<K>>
public boolean isValid()
BackingCacheEntry
NOTE: This method should only be called with the lock held.
isValid
in interface BackingCacheEntry<K extends Serializable,V extends Cacheable<K>>
true
e if still valid, false
e if invalidatedBackingCacheEntry.invalidate()
public int compareTo(BackingCacheEntry<K,V> entry)
compareTo
in interface Comparable<BackingCacheEntry<K extends Serializable,V extends Cacheable<K>>>
Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.