Module org.tentackle.pdo
Package org.tentackle.pdo
Class PdoCacheFileStore<T extends PersistentDomainObject<T>>
java.lang.Object
org.tentackle.pdo.PdoCacheFileStore<T>
- Type Parameters:
T
- the PDO type
- All Implemented Interfaces:
Serializable
public class PdoCacheFileStore<T extends PersistentDomainObject<T>>
extends Object
implements Serializable
A file-based backup store for
Serializes the cache to the filesystem to improve client startup times, especially for preloading caches.
Makes only sense for remote client applications.
PdoCache
.Serializes the cache to the filesystem to improve client startup times, especially for preloading caches.
Makes only sense for remote client applications.
- Author:
- harald
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
readFromFile
(Session session) Loads a cache from persistent storage.
Throws PdoRuntimeException if reading failed.boolean
Writes the cache to persistent storage.
Throws PdoRuntimeException if writing failed.
-
Constructor Details
-
PdoCacheFileStore
Creates a file store for a cache.- Parameters:
cache
- the cache
-
-
Method Details
-
writeToFile
public boolean writeToFile()Writes the cache to persistent storage.
Throws PdoRuntimeException if writing failed.- Returns:
- true if cache has been persisted, false if cache isn't persistable (application is not a client)
-
readFromFile
Loads a cache from persistent storage.
Throws PdoRuntimeException if reading failed.- Parameters:
session
- the session- Returns:
- true if loaded from persistent storage or data was missing, false if cache isn't persistable (application is not a client)
-