|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.hazelcast.cache.impl.record.AbstractCacheRecord<V>
V - the type of the value stored by this AbstractCacheRecordpublic abstract class AbstractCacheRecord<V>
Abstract implementation of CacheRecord with key, value and
expiration time as internal state.
This implementation provides getter, setter and serialization methods.
| Field Summary | |
|---|---|
protected int |
accessHit
|
protected long |
accessTime
|
protected long |
creationTime
|
protected long |
expirationTime
|
| Fields inherited from interface com.hazelcast.cache.impl.record.CacheRecord |
|---|
EXPIRATION_TIME_NOT_AVAILABLE |
| Constructor Summary | |
|---|---|
protected |
AbstractCacheRecord()
|
|
AbstractCacheRecord(long creationTime,
long expirationTime)
|
| Method Summary | |
|---|---|
int |
getAccessHit()
Gets the access hit count of this Evictable. |
long |
getAccessTime()
Gets the latest access time difference of this Evictable in milliseconds. |
long |
getCreationTime()
Gets the creation time of this Evictable in milliseconds. |
long |
getExpirationTime()
Gets the expiration time in milliseconds. |
void |
incrementAccessHit()
Increases the access hit count of this Evictable as 1. |
boolean |
isExpiredAt(long now)
Checks whether the expiration time is passed with respect to the provided time. |
void |
readData(ObjectDataInput in)
Reads fields from the input stream |
void |
resetAccessHit()
Resets the access hit count of this Evictable to 0. |
void |
setAccessHit(int accessHit)
Sets the access hit count of this Evictable. |
void |
setAccessTime(long accessTime)
Sets the access time of this Evictable in milliseconds. |
void |
setCreationTime(long creationTime)
Sets the creation time of this Evictable in milliseconds. |
void |
setExpirationTime(long expirationTime)
Sets the expiration time in milliseconds. |
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.hazelcast.cache.impl.record.CacheRecord |
|---|
getValue, setValue |
| Field Detail |
|---|
protected long creationTime
protected volatile long expirationTime
protected volatile long accessTime
protected volatile int accessHit
| Constructor Detail |
|---|
protected AbstractCacheRecord()
public AbstractCacheRecord(long creationTime,
long expirationTime)
| Method Detail |
|---|
public long getExpirationTime()
Expirable
getExpirationTime in interface ExpirableSystem.currentTimeMillis()public void setExpirationTime(long expirationTime)
Expirable
setExpirationTime in interface ExpirableSystem.currentTimeMillis()public long getCreationTime()
EvictableEvictable in milliseconds.
getCreationTime in interface EvictableEvictable in millisecondspublic void setCreationTime(long creationTime)
CacheRecordEvictable in milliseconds.
setCreationTime in interface CacheRecord<V>creationTime - the creation time for this Evictable in millisecondspublic long getAccessTime()
EvictableEvictable in milliseconds.
getAccessTime in interface EvictableEvictable in millisecondspublic void setAccessTime(long accessTime)
CacheRecordEvictable in milliseconds.
setAccessTime in interface CacheRecord<V>accessTime - the latest access time of this Evictable in millisecondspublic int getAccessHit()
EvictableEvictable.
getAccessHit in interface EvictableEvictablepublic void setAccessHit(int accessHit)
CacheRecordEvictable.
setAccessHit in interface CacheRecord<V>accessHit - the access hit count for this Evictablepublic void incrementAccessHit()
CacheRecordEvictable as 1.
incrementAccessHit in interface CacheRecord<V>public void resetAccessHit()
CacheRecordEvictable to 0.
resetAccessHit in interface CacheRecord<V>public boolean isExpiredAt(long now)
ExpirableReturns true if and only if now > getExpirationTime()
isExpiredAt in interface Expirablenow - time in milliseconds.
public void writeData(ObjectDataOutput out)
throws IOException
DataSerializable
writeData in interface DataSerializableout - output
IOException
public void readData(ObjectDataInput in)
throws IOException
DataSerializable
readData in interface DataSerializablein - input
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||