org.jgroups.persistence

Class DBPersistenceManager

Implemented Interfaces:
PersistenceManager

public class DBPersistenceManager
extends java.lang.Object
implements PersistenceManager

Class will be utilized

Field Summary

protected Log
log

Constructor Summary

DBPersistenceManager(InputStream input)
Duplicate constructor allowing inputstream
DBPersistenceManager(String filename)
Default construct

Method Summary

void
clear()
Clears the key-cache as well as all entries
protected void
init(InputStream in)
used to intitiailize complete DB access.
Serializable
remove(Serializable key)
Used to remove existing entry
Map
retrieveAll()
Used to retrieve the persisted map back to its 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)
Used to save all row entries for the map in to DB
void
shutDown()
Shutting down the database cleanly

Field Details

log

protected Log log

Constructor Details

DBPersistenceManager

public DBPersistenceManager(InputStream input)
            throws Exception
Duplicate constructor allowing inputstream
Parameters:
input -

DBPersistenceManager

public DBPersistenceManager(String filename)
            throws Exception
Default construct
Parameters:
filename - absolute filepath

Method Details

clear

public void clear()
            throws CannotRemoveException
Clears the key-cache as well as all entries
Specified by:
clear in interface PersistenceManager

init

protected void init(InputStream in)
            throws Exception
used to intitiailize complete DB access. THis method will use existing database to create schema (if it doesnt exist) and get PersistenceManager in usable condition
Parameters:
in -

remove

public Serializable remove(Serializable key)
            throws CannotRemoveException
Used to remove existing entry
Specified by:
remove in interface PersistenceManager
Parameters:
Returns:
Serializable; value

retrieveAll

public Map retrieveAll()
            throws CannotRetrieveException
Used to retrieve the persisted map back to its 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
Parameters:

saveAll

public void saveAll(Map map)
            throws CannotPersistException
Used to save all row entries for the map in to DB
Specified by:
saveAll in interface PersistenceManager
Parameters:

shutDown

public void shutDown()
Shutting down the database cleanly
Specified by:
shutDown in interface PersistenceManager

Copyright B) 2001,2002 www.jgroups.com . All Rights Reserved.