public final class LRUCachingMapFactory extends Object
| Constructor and Description |
|---|
LRUCachingMapFactory() |
| Modifier and Type | Method and Description |
|---|---|
static <V extends Serializable> |
createFilenameSerializedCache(LRUCachingMapConfiguration configuration,
CachingDirectory cachingDirectory,
PersistencesRestoreMethod persistencesRestoreMethod)
Constructs a file serialization cache, where the values is serialized to files.
|
static <V> DefaultFileLRUCachingMap<String,V> |
createFilenameXmlCache(LRUCachingMapConfiguration configuration,
CachingDirectory cachingDirectory,
Class<V> xmlClazz,
PersistencesRestoreMethod persistencesRestoreMethod)
Constructs a xml file marshall/unmarshall cache.
|
static DefaultFilenameFileReferenceLRUCachingMap |
createFileReferenceCache(LRUCachingMapConfiguration configuration,
CachingDirectory cachingDirectory,
PersistencesRestoreMethod persistencesRestoreMethod)
Constructs a file reference cache.
|
static <K extends Serializable,V extends Serializable> |
createIndexedSerializedCache(LRUCachingMapConfiguration configuration,
CachingDirectory cachingDirectory,
PersistencesRestoreMethod persistencesRestoreMethod,
int indexSaveInterval)
Constructs a indexed serializable file cache.
|
static <K extends Serializable,V> |
createIndexedXmlCache(LRUCachingMapConfiguration configuration,
CachingDirectory cachingDirectory,
Class<V> xmlClazz,
PersistencesRestoreMethod persistencesRestoreMethod,
int indexSaveInterval)
Constructs a indexed XML file cache.
|
static <K extends Serializable,V extends Serializable> |
createJPACache(LRUCachingMapConfiguration configuration,
Class<? extends CachedJPAEntity<K,V>> entityClazz,
javax.persistence.EntityManagerFactory entityManagerFactory,
PersistencesRestoreMethod persistencesRestoreMethod)
Constructs a JPA cache for an entity.
|
static <K extends Serializable,V extends Serializable> |
createJPAGroupedCache(LRUCachingMapConfiguration configuration,
String group,
Class<? extends CachedGroupJPAEntity<K,V>> entityGroupClazz,
javax.persistence.EntityManagerFactory entityManagerFactory,
PersistencesRestoreMethod persistencesRestoreMethod)
Constructs a group JPA cache for an entity, where multiple cache instances can share the same table.
|
static <K extends Serializable,V extends Keyed<K> & Serializable> |
createKeyedSerializedCache(LRUCachingMapConfiguration configuration,
CachingDirectory cachingDirectory,
PersistencesRestoreMethod persistencesRestoreMethod)
Constructs a keyed serializable file cache.
|
static <K extends Serializable,V extends Keyed<K>> |
createKeyedXmlCache(LRUCachingMapConfiguration configuration,
CachingDirectory cachingDirectory,
Class<V> xmlClazz,
PersistencesRestoreMethod persistencesRestoreMethod)
Constructs a keyed XML file cache.
|
static <K,V> DefaultLRUCachingMap<K,V> |
createMemoryCache(LRUCachingMapConfiguration configuration)
Constructs a memory cache.
|
public static <K,V> DefaultLRUCachingMap<K,V> createMemoryCache(LRUCachingMapConfiguration configuration) throws NullPointerException
configuration - the configuration.NullPointerExceptionDefaultLRUCachingMapConfiguration,
DefaultLRUCachingMap,
DefaultMemoryValueManagerpublic static DefaultFilenameFileReferenceLRUCachingMap createFileReferenceCache(LRUCachingMapConfiguration configuration, CachingDirectory cachingDirectory, PersistencesRestoreMethod persistencesRestoreMethod)
configuration - the configuration.cachingDirectory - where to look after files when restoring the cache.persistencesRestoreMethod - which method to use when restoring the cache.DefaultLRUCachingMapConfigurationpublic static <K extends Serializable,V> DefaultFileLRUCachingMap<K,V> createIndexedXmlCache(LRUCachingMapConfiguration configuration, CachingDirectory cachingDirectory, Class<V> xmlClazz, PersistencesRestoreMethod persistencesRestoreMethod, int indexSaveInterval)
configuration - the configuration.cachingDirectory - where to look after files when restoring the cache.xmlClazz - the class of V which has an XmlRootElement annotation.persistencesRestoreMethod - which method to use when restoring the cache.indexSaveInterval - how many changes (put,remove) must occur before the index file (filename to key) index is persisted.public static <K extends Serializable,V extends Keyed<K>> DefaultFileLRUCachingMap<K,V> createKeyedXmlCache(LRUCachingMapConfiguration configuration, CachingDirectory cachingDirectory, Class<V> xmlClazz, PersistencesRestoreMethod persistencesRestoreMethod)
configuration - the configuration.cachingDirectory - where to look after files when restoring the cache.xmlClazz - the class of V which has an XmlRootElement annotation.persistencesRestoreMethod - which method to use when restoring the cache.public static <V> DefaultFileLRUCachingMap<String,V> createFilenameXmlCache(LRUCachingMapConfiguration configuration, CachingDirectory cachingDirectory, Class<V> xmlClazz, PersistencesRestoreMethod persistencesRestoreMethod)
configuration - the configurationcachingDirectory - the directory where the xml files is stored, and loaded and restored from.xmlClazz - the class of V which has an XmlRootElement annotation.persistencesRestoreMethod - which method to use when restoring the cache.XmlRootElementpublic static <K extends Serializable,V extends Serializable> DefaultFileLRUCachingMap<K,V> createIndexedSerializedCache(LRUCachingMapConfiguration configuration, CachingDirectory cachingDirectory, PersistencesRestoreMethod persistencesRestoreMethod, int indexSaveInterval)
configuration - the configuration.cachingDirectory - where to look after files when restoring the cache.persistencesRestoreMethod - which method to use when restoring the cache.indexSaveInterval - how many changes (put,remove) must occur before the index file (filename to key) index is persisted.public static <K extends Serializable,V extends Keyed<K> & Serializable> DefaultFileLRUCachingMap<K,V> createKeyedSerializedCache(LRUCachingMapConfiguration configuration, CachingDirectory cachingDirectory, PersistencesRestoreMethod persistencesRestoreMethod)
configuration - the configuration.cachingDirectory - where to look after files when restoring the cache.persistencesRestoreMethod - which method to use when restoring the cache.public static <V extends Serializable> DefaultFileLRUCachingMap<String,V> createFilenameSerializedCache(LRUCachingMapConfiguration configuration, CachingDirectory cachingDirectory, PersistencesRestoreMethod persistencesRestoreMethod)
configuration - the configurationcachingDirectory - the directory where the files is serialized to, and loaded and restored from.persistencesRestoreMethod - which method to use when restoring the cache.public static <K extends Serializable,V extends Serializable> DefaultLRUCachingMap<K,V> createJPACache(LRUCachingMapConfiguration configuration, Class<? extends CachedJPAEntity<K,V>> entityClazz, javax.persistence.EntityManagerFactory entityManagerFactory, PersistencesRestoreMethod persistencesRestoreMethod)
configuration - the configurationentityClazz - a class instance which extends CachedJPAEntity and has JPA annotations.entityManagerFactory - an instance of entityManagerFactory.persistencesRestoreMethod - which method to use when restoring the cache.public static <K extends Serializable,V extends Serializable> DefaultLRUCachingMap<K,V> createJPAGroupedCache(LRUCachingMapConfiguration configuration, String group, Class<? extends CachedGroupJPAEntity<K,V>> entityGroupClazz, javax.persistence.EntityManagerFactory entityManagerFactory, PersistencesRestoreMethod persistencesRestoreMethod)
configuration - the configurationgroup - the group name of the cache.entityGroupClazz - a class instance which extends CachedGroupJPAEntity and has JPA annotations.entityManagerFactory - an instance of entityManagerFactory.persistencesRestoreMethod - which method to use when restoring the cache.Copyright © 2016. All rights reserved.