public class DBPersistenceManager extends java.lang.Object implements PersistenceManager
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.logging.Log |
log |
| Constructor and Description |
|---|
DBPersistenceManager(java.io.InputStream input)
Duplicate constructor allowing inputstream
|
DBPersistenceManager(java.lang.String filename)
Default construct
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears the key-cache as well as all entries
|
protected void |
init(java.io.InputStream in)
used to intitiailize complete DB access.
|
java.io.Serializable |
remove(java.io.Serializable key)
Removes existing entry.
|
java.util.Map |
retrieveAll()
Used to retrieve the persisted map back to its last known state
|
void |
save(java.io.Serializable key,
java.io.Serializable val)
Saves NV pair as serializable object;
creates if new, stores new state if already exists.
|
void |
saveAll(java.util.Map map)
Saves all row entries for the map to DB.
|
void |
shutDown()
Shutting down the database cleanly
|
public DBPersistenceManager(java.lang.String filename)
throws java.lang.Exception
filename - absolute filepathException;java.lang.Exceptionpublic DBPersistenceManager(java.io.InputStream input)
throws java.lang.Exception
input - java.lang.Exceptionprotected void init(java.io.InputStream in)
throws java.lang.Exception
in - Exception;java.lang.Exceptionpublic void save(java.io.Serializable key,
java.io.Serializable val)
throws CannotPersistException
save in interface PersistenceManagerkey - val - CannotPersistException;CannotPersistExceptionpublic java.io.Serializable remove(java.io.Serializable key)
throws CannotRemoveException
remove in interface PersistenceManagerkey - CannotRemoveException;CannotRemoveExceptionpublic void saveAll(java.util.Map map)
throws CannotPersistException
saveAll in interface PersistenceManagermap - CannotPersistException;CannotPersistExceptionpublic java.util.Map retrieveAll()
throws CannotRetrieveException
retrieveAll in interface PersistenceManagerCannotRetrieveException;CannotRetrieveExceptionpublic void clear()
throws CannotRemoveException
clear in interface PersistenceManagerCannotRemoveException;CannotRemoveExceptionpublic void shutDown()
shutDown in interface PersistenceManagerCopyright ? 1998-2008 Bela Ban. All Rights Reserved.