public class DefaultNearCache<K,V> extends Object implements NearCache<K,V>
| Modifier and Type | Field and Description | 
|---|---|
| protected ClassLoader | classLoader | 
| protected ExecutionService | executionService | 
| protected ScheduledFuture | expirationTaskFuture | 
| protected String | name | 
| protected NearCacheConfig | nearCacheConfig | 
| protected NearCacheRecordStore<K,V> | nearCacheRecordStore | 
| protected SerializationService | serializationService | 
DEFAULT_EXPIRATION_TASK_DELAY_IN_SECONDS, DEFAULT_EXPIRATION_TASK_INITIAL_DELAY_IN_SECONDS, NULL_OBJECT| Constructor and Description | 
|---|
| DefaultNearCache(String name,
                NearCacheConfig nearCacheConfig,
                NearCacheRecordStore<K,V> nearCacheRecordStore,
                SerializationService serializationService,
                ExecutionService executionService,
                ClassLoader classLoader) | 
| DefaultNearCache(String name,
                NearCacheConfig nearCacheConfig,
                SerializationService serializationService,
                ExecutionService executionService,
                ClassLoader classLoader) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | clear()Removes all stored values. | 
| protected NearCacheRecordStore<K,V> | createNearCacheRecordStore(String name,
                          NearCacheConfig nearCacheConfig) | 
| void | destroy()Clears the record store and destroys it. | 
| V | get(K key)Gets the value associated with the given  key. | 
| InMemoryFormat | getInMemoryFormat()Gets the  InMemoryFormatof the storage for internal records. | 
| String | getName()Gets the name of this  NearCacheinstance. | 
| NearCacheRecordStore<K,V> | getNearCacheRecordStore() | 
| NearCacheStats | getNearCacheStats()Get the  NearCacheStatsinstance to monitor this store. | 
| NearCachePreloaderConfig | getPreloaderConfig()Gets the  NearCachePreloaderConfigof this Near Cache. | 
| void | initialize() | 
| boolean | isInvalidatedOnChange()Checks if values are invalidated on changes. | 
| boolean | isPreloadDone()Checks if the pre-loading of the Near Cache is done. | 
| void | preload(DataStructureAdapter<Data,?> adapter)Executes the Near Cache pre-loader on the given  DataStructureAdapter. | 
| void | put(K key,
   V value)Puts (associates) a value with the given  key. | 
| boolean | remove(K key)Removes the value associated with the given  key. | 
| Object | selectToSave(Object... candidates)Selects the best candidate object to store from the given  candidates. | 
| int | size()Gets the count of stored records. | 
| void | storeKeys()Stores the keys of the Near Cache. | 
| <T> T | unwrap(Class<T> clazz)Used to access non-standard methods of an implementation. | 
protected final String name
protected final NearCacheConfig nearCacheConfig
protected final SerializationService serializationService
protected final ExecutionService executionService
protected final ClassLoader classLoader
protected NearCacheRecordStore<K,V> nearCacheRecordStore
protected ScheduledFuture expirationTaskFuture
public DefaultNearCache(String name, NearCacheConfig nearCacheConfig, SerializationService serializationService, ExecutionService executionService, ClassLoader classLoader)
public DefaultNearCache(String name, NearCacheConfig nearCacheConfig, NearCacheRecordStore<K,V> nearCacheRecordStore, SerializationService serializationService, ExecutionService executionService, ClassLoader classLoader)
public void initialize()
initialize in interface InitializingObjectprotected NearCacheRecordStore<K,V> createNearCacheRecordStore(String name, NearCacheConfig nearCacheConfig)
public String getName()
NearCacheNearCache instance.public V get(K key)
NearCachekey.public void put(K key, V value)
NearCachekey.public boolean remove(K key)
NearCachekey.public boolean isInvalidatedOnChange()
NearCacheisInvalidatedOnChange in interface NearCache<K,V>true if values are invalidated on changes, false otherwisepublic void clear()
NearCachepublic void destroy()
NearCachepublic InMemoryFormat getInMemoryFormat()
NearCacheInMemoryFormat of the storage for internal records.getInMemoryFormat in interface NearCache<K,V>InMemoryFormat of the storage for internal recordspublic NearCachePreloaderConfig getPreloaderConfig()
NearCacheNearCachePreloaderConfig of this Near Cache.getPreloaderConfig in interface NearCache<K,V>NearCachePreloaderConfig of this Near Cachepublic NearCacheStats getNearCacheStats()
NearCacheNearCacheStats instance to monitor this store.getNearCacheStats in interface NearCache<K,V>NearCacheStats instance to monitor this storepublic Object selectToSave(Object... candidates)
NearCachecandidates.selectToSave in interface NearCache<K,V>candidates - the candidates from which the best candidate object will be selected.candidates.public int size()
NearCachepublic void preload(DataStructureAdapter<Data,?> adapter)
NearCacheDataStructureAdapter.public void storeKeys()
NearCachepublic boolean isPreloadDone()
NearCacheisPreloadDone in interface NearCache<K,V>true if the pre-loading is done, false otherwise.public <T> T unwrap(Class<T> clazz)
NearCacheIf this method is called on a wrapper object, result is wrapped object.
public NearCacheRecordStore<K,V> getNearCacheRecordStore()
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.