Package org.jgroups.persistence
Class FilePersistenceManager
- java.lang.Object
-
- org.jgroups.persistence.FilePersistenceManager
-
- All Implemented Interfaces:
PersistenceManager
public class FilePersistenceManager extends java.lang.Object implements PersistenceManager
-
-
Constructor Summary
Constructors Constructor Description FilePersistenceManager(java.lang.String propertiesFilename)Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears the complete NV state from the DBprotected java.util.MapfilterLoadedValues(java.util.Map in)Turns the values into Floats to enableDistributedHashtableDemoto work.java.io.Serializableremove(java.io.Serializable key)Remove existing NV from being persistedjava.util.MapretrieveAll()Gives back the Map in last known statevoidsave(java.io.Serializable key, java.io.Serializable val)Save new NV pair as serializable objects or if already exist; store new statevoidsaveAll(java.util.Map map)Use to store a complete map into persistent statevoidshutDown()Used to handle shutdown call the PersistenceManager implementation.
-
-
-
Method Detail
-
save
public void save(java.io.Serializable key, java.io.Serializable val) throws CannotPersistExceptionSave new NV pair as serializable objects or if already exist; store new state- Specified by:
savein interfacePersistenceManager- Throws:
CannotPersistException
-
remove
public java.io.Serializable remove(java.io.Serializable key) throws CannotRemoveExceptionRemove existing NV from being persisted- Specified by:
removein interfacePersistenceManager- Parameters:
key- value- Returns:
- Serializable; gives back the value
- Throws:
CannotRemoveException
-
saveAll
public void saveAll(java.util.Map map) throws CannotPersistExceptionUse to store a complete map into persistent state- Specified by:
saveAllin interfacePersistenceManager- Throws:
CannotPersistException
-
retrieveAll
public java.util.Map retrieveAll() throws CannotRetrieveExceptionGives back the Map in last known state- Specified by:
retrieveAllin interfacePersistenceManager- Returns:
- Map;
- Throws:
CannotRetrieveException
-
filterLoadedValues
protected java.util.Map filterLoadedValues(java.util.Map in)
Turns the values into Floats to enableDistributedHashtableDemoto work. Subclasses should override this method to convert the incoming map of string/string key/value pairs into the types they want.- Parameters:
in-- Returns:
- Map
-
clear
public void clear() throws CannotRemoveExceptionClears the complete NV state from the DB- Specified by:
clearin interfacePersistenceManager- Throws:
CannotRemoveException
-
shutDown
public void shutDown()
Used to handle shutdown call the PersistenceManager implementation. Persistent engines can leave this implementation empty.- Specified by:
shutDownin interfacePersistenceManager
-
-