public class JCacheEntryMetaInf extends Object implements ExternalizableLite, PortableObject
Cache
.
The meta info is stored as a Coherence decoration on the value in ParitionedCache}.
The meta info is a member of a LocalCacheValue
;
JCacheEntryMetaInf
s store and provide meta information about
a Cache Entry, including information for dealing with expiry.
Constructor and Description |
---|
JCacheEntryMetaInf()
Constructs a
JCacheEntryMetaInf . |
JCacheEntryMetaInf(JCacheEntryMetaInf metaInf)
Copy constructor
|
JCacheEntryMetaInf(long ldtCreated,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
Constructs an
JCacheEntryMetaInf . |
Modifier and Type | Method and Description |
---|---|
void |
accessed(long ldtAccessed,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
Update the
JCacheEntryMetaInf based on the associated entry
being accessed at the specified 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.
|
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 now)
Determines if the Cache Entry associated with this value would be expired
at the specified time
|
void |
modified(long ldtModified,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
Update the
JCacheEntryMetaInf based on the associated entry
being modified at the specified time. |
void |
readExternal(DataInput dataInput)
read from datainput
|
void |
readExternal(PofReader pofReader)
Restore the contents of a user type instance by reading its state using
the specified PofReader object.
|
void |
setAccessTime(long accessTime)
Gets the internal value with the side-effect of updating the access time
to that which is specified and incrementing the access count.
|
void |
setExpiryTime(long expiryTime)
Sets the time (since the Epoc) in milliseconds when the Cache Entry
associated with this value should be considered expired.
|
void |
setModificationTime(long modificationTime)
Sets update the
modification time for the meta data for a key and value pair.
|
String |
toString() |
void |
writeExternal(DataOutput dataOutput)
write to
|
void |
writeExternal(PofWriter pofWriter)
Save the contents of a POF user type instance by writing its state using
the specified PofWriter object.
|
public JCacheEntryMetaInf()
JCacheEntryMetaInf
.public JCacheEntryMetaInf(JCacheEntryMetaInf metaInf)
metaInf
- public JCacheEntryMetaInf(long ldtCreated, javax.cache.expiry.ExpiryPolicy expiryPolicy)
JCacheEntryMetaInf
.ldtCreated
- the time when the cache entry was createdexpiryPolicy
- the ExpiryPolicy
to determine the expiry timepublic long getCreationTime()
public long getAccessTime()
public long getAccessCount()
public long getModificationTime()
public long getModificationCount()
public long getExpiryTime()
public void setExpiryTime(long expiryTime)
expiryTime
- time in milliseconds (since the Epoc)public boolean isExpiredAt(long now)
now
- time in milliseconds (since the Epoc)public void setAccessTime(long accessTime)
accessTime
- the time when the related value was accessedpublic void setModificationTime(long modificationTime)
public void accessed(long ldtAccessed, javax.cache.expiry.ExpiryPolicy expiryPolicy)
JCacheEntryMetaInf
based on the associated entry
being accessed at the specified time.ldtAccessed
- the time the entry was accessedexpiryPolicy
- the ExpiryPolicy
for the Cache
public void modified(long ldtModified, javax.cache.expiry.ExpiryPolicy expiryPolicy)
JCacheEntryMetaInf
based on the associated entry
being modified at the specified time.ldtModified
- the time the entry was accessedexpiryPolicy
- the ExpiryPolicy
for the Cache
public void readExternal(DataInput dataInput) throws IOException
readExternal
in interface ExternalizableLite
dataInput
- IOException
NotActiveException
- if the object is not in its initial
state, and therefore cannot be deserialized intopublic void writeExternal(DataOutput dataOutput) throws IOException
writeExternal
in interface ExternalizableLite
dataOutput
- IOException
public void readExternal(PofReader pofReader) throws IOException
PortableObject
readExternal
in interface PortableObject
pofReader
- the PofReader from which to read the object's stateIOException
- if an I/O error occurspublic void writeExternal(PofWriter pofWriter) throws IOException
PortableObject
writeExternal
in interface PortableObject
pofWriter
- the PofWriter to which to write the object's stateIOException
- if an I/O error occurs