com.hazelcast.cache.impl.record
Class CacheRecordFactory<R extends CacheRecord>

java.lang.Object
  extended by com.hazelcast.cache.impl.record.CacheRecordFactory<R>

public class CacheRecordFactory<R extends CacheRecord>
extends Object

Provides factory for CacheRecord.

Key, value and expiryTime are packed into a subclass of AbstractCacheRecord depending on the configured inMemoryFormat.


Field Summary
protected  InMemoryFormat inMemoryFormat
           
protected  SerializationService serializationService
           
 
Constructor Summary
CacheRecordFactory(InMemoryFormat inMemoryFormat, SerializationService serializationService)
           
 
Method Summary
protected  CacheRecord createCacheDataRecord(Data dataValue, long creationTime, long expiryTime)
           
protected  CacheRecord createCacheObjectRecord(Object objectValue, long creationTime, long expiryTime)
           
static boolean isExpiredAt(long expirationTime, long now)
          Determines whether the Cache Entry associated with this value would be expired at the specified time.
 R newRecord(Object value)
           
 R newRecordWithExpiry(Object value, long creationTime, long expiryTime)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inMemoryFormat

protected InMemoryFormat inMemoryFormat

serializationService

protected SerializationService serializationService
Constructor Detail

CacheRecordFactory

public CacheRecordFactory(InMemoryFormat inMemoryFormat,
                          SerializationService serializationService)
Method Detail

newRecord

public R newRecord(Object value)

newRecordWithExpiry

public R newRecordWithExpiry(Object value,
                             long creationTime,
                             long expiryTime)

createCacheDataRecord

protected CacheRecord createCacheDataRecord(Data dataValue,
                                            long creationTime,
                                            long expiryTime)

createCacheObjectRecord

protected CacheRecord createCacheObjectRecord(Object objectValue,
                                              long creationTime,
                                              long expiryTime)

isExpiredAt

public static boolean isExpiredAt(long expirationTime,
                                  long now)
Determines whether the Cache Entry associated with this value would be expired at the specified time.

Parameters:
now - time in milliseconds (since the Epoc).
Returns:
true if the value would be expired at the specified time.


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.