K
- the key type.V
- the value type.public class DefaultKeyedSerializableFileValueManager<K extends Serializable,V extends Keyed<K> & Serializable> extends AbstractKeyedFileValueManager<K,V>
Serializable
and Keyed
.SerializableUtils.writeSerializableToFile(java.io.File, Serializable)
,
SerializableUtils.readSerializableFromFile(java.io.File)
Constructor and Description |
---|
DefaultKeyedSerializableFileValueManager(CachingDirectory cachingDirectory,
PersistencesRestoreMethod persistencesRestoreMethod)
Constructor
|
Modifier and Type | Method and Description |
---|---|
V |
retrieveFileValue(DefaultFileValueWrapper<K,V> valueWrapper)
Loads the value from the file in valueWrapper.
|
void |
storeFileValue(DefaultFileValueWrapper<K,V> valueWrapper,
K key,
V value)
This method shall the take the Value and stored it in a file given by the valueWrapper.
|
constructFile, flush, reconstructKey, retrieveValue, storeValue
cast, constructWrapper, getCachingDirectory, getFile, removeAll, removeValue, restore, updateExpireTime
getLogger, getPersistencesRestoreMethod, isPersisted
public DefaultKeyedSerializableFileValueManager(CachingDirectory cachingDirectory, PersistencesRestoreMethod persistencesRestoreMethod) throws IllegalArgumentException, NullPointerException
cachingDirectory
- the directory where to store the cached values.persistencesRestoreMethod
- the restore method, when reconstructing the LRUCachingMap.IllegalArgumentException
- if cacheDirectory isnt a valid directory.NullPointerException
- if persistencesRestoreMethod or cachingDirectory is null
.public void storeFileValue(DefaultFileValueWrapper<K,V> valueWrapper, K key, V value) throws RuntimeException
AbstractKeyedFileValueManager
storeFileValue
in class AbstractKeyedFileValueManager<K extends Serializable,V extends Keyed<K> & Serializable>
valueWrapper
- the value wrapper which holds the file.key
- the key.value
- the value.RuntimeException
- if the value can not be stored in the file.public V retrieveFileValue(DefaultFileValueWrapper<K,V> valueWrapper)
AbstractKeyedFileValueManager
retrieveFileValue
in class AbstractKeyedFileValueManager<K extends Serializable,V extends Keyed<K> & Serializable>
valueWrapper
- the value wrapperCopyright © 2016. All rights reserved.