public class LocalCacheValue extends Object
LocalCache.
The actual value passed to the Cache is represented in an internal format,
generated by passing the value through an InternalConverter.
LocalCacheValues additionally store and provide meta information about
Cache Entry Values, including information for dealing with expiry.
| Modifier and Type | Class and Description |
|---|---|
static class |
LocalCacheValue.JCacheSyntheticKind
Synthetic Update
|
| Constructor and Description |
|---|
LocalCacheValue(LocalCacheValue oldValue)
Copy constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
accessInternalValue(long ldtAccess,
javax.cache.expiry.ExpiryPolicy policy)
Access value
|
static LocalCacheValue |
createLoadedLocalCacheValue(Object internalValue,
long ldtCreation,
javax.cache.expiry.ExpiryPolicy policy)
Create a LocalCacheValue marked with Synthetic marker that it was loaded.
|
static LocalCacheValue |
createLocalCacheValue(Object internalValue,
long ldtCreation,
javax.cache.expiry.ExpiryPolicy policy)
Create a LocalCacheValue for an LocalCache entry.
|
Object |
get()
Gets the internal value (without updating the access time).
|
long |
getAccessCount()
Gets the number of times the internal value has been accessed.
|
long |
getAccessTime()
Gets the time (since the Epoc) in milliseconds since the internal value
was last accessed.
|
long |
getCreationTime()
Gets the time (since the Epoc) in milliseconds since the internal value
was created.
|
long |
getExpiryTime()
Gets the time (since the Epoc) in milliseconds when the Cache Entry
associated with this value should be considered expired.
|
Object |
getInternalValue()
Access internal value without updating access expiry.
|
Object |
getInternalValue(long ldtAccess)
Gets the internal value with the side-effect of updating the access time
to that which is specified and incrementing the access count.
|
long |
getModificationCount()
Gets the number of times the internal value has been modified (set)
|
long |
getModificationTime()
Gets the time (since the Epoc) in milliseconds since the internal value
was last modified.
|
boolean |
isExpiredAt(long ldtNow)
Determines if the Cache Entry associated with this value would be expired
at the specified time
|
boolean |
isLoaded()
Determine if last update to this LocalValue was a load from an external resource.
|
boolean |
isSyntheticUpdate()
determine if last update was considered synthetic
|
void |
set(Object internalValue)
Sets the internal value (without updating the modification time)
|
void |
setExpiryTime(long ldtExpiry)
Sets the time (since the Epoc) in milliseconds when the Cache Entry
associated with this value should be considered expired.
|
LocalCacheValue |
updateInternalValue(Object internalValue,
long ldtModification,
javax.cache.expiry.ExpiryPolicy policy)
Sets the internal value with the additional side-effect of updating the
modification time to that which is specified and incrementing the
modification count.
|
public LocalCacheValue(LocalCacheValue oldValue)
oldValue - the old local cache valuepublic long getCreationTime()
public long getAccessTime()
public long getAccessCount()
public long getModificationTime()
public long getModificationCount()
public long getExpiryTime()
public void setExpiryTime(long ldtExpiry)
ldtExpiry - time in milliseconds (since the Epoc)public boolean isExpiredAt(long ldtNow)
ldtNow - time in milliseconds (since the Epoc)public Object get()
public void set(Object internalValue)
internalValue - the new internal valuepublic Object getInternalValue(long ldtAccess)
ldtAccess - the time when the internal value was accessedpublic Object getInternalValue()
public LocalCacheValue updateInternalValue(Object internalValue, long ldtModification, javax.cache.expiry.ExpiryPolicy policy)
internalValue - the new internal valueldtModification - the time when the value was modifiedpolicy - the expiry policypublic void accessInternalValue(long ldtAccess,
javax.cache.expiry.ExpiryPolicy policy)
ldtAccess - the time when the value was accessedpolicy - the expiry policypublic static LocalCacheValue createLoadedLocalCacheValue(Object internalValue, long ldtCreation, javax.cache.expiry.ExpiryPolicy policy)
internalValue - internal format of value of a LocalCache entryldtCreation - creation timepolicy - expiry policy to useLocalCacheValue marked as loaded via read-throughpublic static LocalCacheValue createLocalCacheValue(Object internalValue, long ldtCreation, javax.cache.expiry.ExpiryPolicy policy)
internalValue - internal format of valueldtCreation - entry creation timepolicy - expiry policy to use to generate expiry for the new LocalCache entry.LocalCache with appropriate JCache MetaInfo.public boolean isSyntheticUpdate()
public boolean isLoaded()