org.jgroups.persistence

Class FilePersistenceManager

public class FilePersistenceManager extends Object implements PersistenceManager

Author: Mandar Shinde The class implements the PersistenceManager interface and provides users a file based implementation when required. The state of this class is current NOOP. Implementation will be in place once a better structure for file based properties will be designed.

Constructor Summary
FilePersistenceManager(String propertiesFilename)
Default constructor
Method Summary
voidclear()
Clears the complete NV state from the DB
protected MapfilterLoadedValues(Map in)
Turns the values into Floats to enable DistributedHashtableDemo to work.
Serializableremove(Serializable key)
Remove existing NV from being persisted
MapretrieveAll()
Gives back the Map in last known state
voidsave(Serializable key, Serializable val)
Save new NV pair as serializable objects or if already exist; store new state
voidsaveAll(Map map)
Use to store a complete map into persistent state
voidshutDown()
Used to handle shutdown call the PersistenceManager implementation.

Constructor Detail

FilePersistenceManager

public FilePersistenceManager(String propertiesFilename)
Default constructor

Method Detail

clear

public void clear()
Clears the complete NV state from the DB

Throws: CannotRemoveException; x

filterLoadedValues

protected Map filterLoadedValues(Map in)
Turns the values into Floats to enable DistributedHashtableDemo to 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

remove

public Serializable remove(Serializable key)
Remove existing NV from being persisted

retrieveAll

public Map retrieveAll()
Gives back the Map in last known state

Returns: Map;

Throws: CannotRetrieveException;

save

public void save(Serializable key, Serializable val)
Save new NV pair as serializable objects or if already exist; store new state

saveAll

public void saveAll(Map map)
Use to store a complete map into persistent state

Throws: CannotPersistException;

shutDown

public void shutDown()
Used to handle shutdown call the PersistenceManager implementation. Persistent engines can leave this implementation empty.
Copyright ? 1998-2005 Bela Ban. All Rights Reserved.