V
- the value V, which can stored and loaded using JAXB.public final class DefaultFilenameXmlFileValueManager<V> extends AbstractFilenameFileValueManager<V>
@XmlRootElement
.XmlUtils.writeXmlToFile(java.io.File, Object)
,
XmlUtils.readXmlFromFile(java.io.File, Class)
Constructor and Description |
---|
DefaultFilenameXmlFileValueManager(CachingDirectory cachingDirectory,
Class<V> xmlClazz,
PersistencesRestoreMethod persistencesRestoreMethod)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Class<V> |
getXmlClazz()
The class name of V.
|
V |
retrieveFileValue(DefaultFileValueWrapper<String,V> valueWrapper)
Loads the value from the file in valueWrapper.
|
void |
storeFileValue(DefaultFileValueWrapper<String,V> valueWrapper,
String 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 DefaultFilenameXmlFileValueManager(CachingDirectory cachingDirectory, Class<V> xmlClazz, PersistencesRestoreMethod persistencesRestoreMethod) throws IllegalArgumentException, NullPointerException
cachingDirectory
- the directory where to store the cached values.xmlClazz
- the class name of V.persistencesRestoreMethod
- the restore method, when reconstructing the LRUCachingMap.IllegalArgumentException
- if cacheDirectory isnt a valid directory or if xmlClazz is not annotated with "@XmlRootElement".NullPointerException
- if cachingDirectory, xmlClazz,or persistencesRestoreMethod is null
.public V retrieveFileValue(DefaultFileValueWrapper<String,V> valueWrapper)
AbstractFilenameFileValueManager
retrieveFileValue
in class AbstractFilenameFileValueManager<V>
valueWrapper
- the value wrapperpublic void storeFileValue(DefaultFileValueWrapper<String,V> valueWrapper, String key, V value) throws RuntimeException
AbstractFilenameFileValueManager
storeFileValue
in class AbstractFilenameFileValueManager<V>
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.Copyright © 2016. All rights reserved.