org.jgroups.persistence

Class FilePersistenceManager

Implemented Interfaces:
PersistenceManager

public class FilePersistenceManager
extends java.lang.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

void
clear()
Clears the complete NV state from the DB
protected Map
filterLoadedValues(Map in)
Turns the values into Floats to enable DistributedHashtableDemo to work.
Serializable
remove(Serializable key)
Remove existing NV from being persisted
Map
retrieveAll()
Gives back the Map in last known state
void
save(Serializable key, Serializable val)
Save new NV pair as serializable objects or if already exist; store new state
void
saveAll(Map map)
Use to store a complete map into persistent state
void
shutDown()
Used to handle shutdown call the PersistenceManager implementation.

Constructor Details

FilePersistenceManager

public FilePersistenceManager(String propertiesFilename)
            throws Exception
Default constructor

Method Details

clear

public void clear()
            throws CannotRemoveException
Clears the complete NV state from the DB
Specified by:
clear in interface PersistenceManager

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)
            throws CannotRemoveException
Remove existing NV from being persisted
Specified by:
remove in interface PersistenceManager

retrieveAll

public Map retrieveAll()
            throws CannotRetrieveException
Gives back the Map in last known state
Specified by:
retrieveAll in interface PersistenceManager
Returns:
Map;

save

public void save(Serializable key,
                 Serializable val)
            throws CannotPersistException
Save new NV pair as serializable objects or if already exist; store new state
Specified by:
save in interface PersistenceManager

saveAll

public void saveAll(Map map)
            throws CannotPersistException
Use to store a complete map into persistent state
Specified by:
saveAll in interface PersistenceManager

shutDown

public void shutDown()
Used to handle shutdown call the PersistenceManager implementation. Persistent engines can leave this implementation empty.
Specified by:
shutDown in interface PersistenceManager

Copyright B) 1998-2005 Bela Ban. All Rights Reserved.