Package org.jgroups.persistence
Class DBPersistenceManager
java.lang.Object
org.jgroups.persistence.DBPersistenceManager
- All Implemented Interfaces:
PersistenceManager
Class will be utilized
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDBPersistenceManager
(InputStream input) Duplicate constructor allowing inputstreamDBPersistenceManager
(String filename) Default construct -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears the key-cache as well as all entriesprotected void
init
(InputStream in) used to intitiailize complete DB access.remove
(Serializable key) Removes existing entry.Used to retrieve the persisted map back to its last known statevoid
save
(Serializable key, Serializable val) Saves NV pair as serializable object; creates if new, stores new state if already exists.void
Saves all row entries for the map to DB.void
shutDown()
Shutting down the database cleanly
-
Field Details
-
log
protected final org.apache.commons.logging.Log log
-
-
Constructor Details
-
Method Details
-
init
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
-
save
Saves NV pair as serializable object; creates if new, stores new state if already exists.- Specified by:
save
in interfacePersistenceManager
- Parameters:
key
-val
-- Throws:
CannotPersistException
-
remove
Removes existing entry.- Specified by:
remove
in interfacePersistenceManager
- Parameters:
key
-- Returns:
- Serializable; gives back the value
- Throws:
CannotRemoveException
-
saveAll
Saves all row entries for the map to DB.- Specified by:
saveAll
in interfacePersistenceManager
- Parameters:
map
-- Throws:
CannotPersistException
-
retrieveAll
Used to retrieve the persisted map back to its last known state- Specified by:
retrieveAll
in interfacePersistenceManager
- Returns:
- Map;
- Throws:
CannotRetrieveException
-
clear
Clears the key-cache as well as all entries- Specified by:
clear
in interfacePersistenceManager
- Throws:
CannotRemoveException
-
shutDown
public void shutDown()Shutting down the database cleanly- Specified by:
shutDown
in interfacePersistenceManager
-