org.jgroups.persistence

Class DBPersistenceManager

public class DBPersistenceManager extends Object implements PersistenceManager

Class will be utilized
Field Summary
protected Loglog
Constructor Summary
DBPersistenceManager(String filename)
Default construct
DBPersistenceManager(InputStream input)
Duplicate constructor allowing inputstream
Method Summary
voidclear()
Clears the key-cache as well as all entries
protected voidinit(InputStream in)
used to intitiailize complete DB access.
Serializableremove(Serializable key)
Removes existing entry.
MapretrieveAll()
Used to retrieve the persisted map back to its last known state
voidsave(Serializable key, Serializable val)
Saves NV pair as serializable object; creates if new, stores new state if already exists.
voidsaveAll(Map map)
Saves all row entries for the map to DB.
voidshutDown()
Shutting down the database cleanly

Field Detail

log

protected final Log log

Constructor Detail

DBPersistenceManager

public DBPersistenceManager(String filename)
Default construct

Parameters: filename absolute filepath

Throws: Exception;

DBPersistenceManager

public DBPersistenceManager(InputStream input)
Duplicate constructor allowing inputstream

Parameters: input

Throws: Exception

Method Detail

clear

public void clear()
Clears the key-cache as well as all entries

Throws: CannotRemoveException;

init

protected void init(InputStream in)
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

Throws: Exception;

remove

public Serializable remove(Serializable key)
Removes existing entry.

Parameters: key

Throws: CannotRemoveException;

retrieveAll

public Map retrieveAll()
Used to retrieve the persisted map back to its last known state

Returns: Map;

Throws: CannotRetrieveException;

save

public void save(Serializable key, Serializable val)
Saves NV pair as serializable object; creates if new, stores new state if already exists.

Parameters: key val

Throws: CannotPersistException;

saveAll

public void saveAll(Map map)
Saves all row entries for the map to DB.

Parameters: map

Throws: CannotPersistException;

shutDown

public void shutDown()
Shutting down the database cleanly
Copyright ? 1998-2005 Bela Ban. All Rights Reserved.