org.javagroups.persistence
Class DBPersistenceManager

java.lang.Object
  |
  +--org.javagroups.persistence.DBPersistenceManager
All Implemented Interfaces:
PersistenceManager

public class DBPersistenceManager
extends java.lang.Object
implements PersistenceManager

Class will be utilized


Constructor Summary
DBPersistenceManager(java.io.InputStream input)
          Duplicate constructor allowing inputstream
DBPersistenceManager(java.lang.String filename)
          Default construct
 
Method Summary
 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)
          Used to remove 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)
          Save new NV pair as serializable objects or if already exist; store new state
 void saveAll(java.util.Map map)
          Used to save all row entries for the map in to DB
 void shutDown()
          Shutting down the database cleanly
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBPersistenceManager

public DBPersistenceManager(java.lang.String filename)
                     throws java.lang.Exception
Default construct

Parameters:
filename - absolute filepath
Throws:
Exception;
java.lang.Exception

DBPersistenceManager

public DBPersistenceManager(java.io.InputStream input)
                     throws java.lang.Exception
Duplicate constructor allowing inputstream

Parameters:
input -
Throws:
java.lang.Exception
Method Detail

init

protected void init(java.io.InputStream in)
             throws java.lang.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

Throws:
Exception;
java.lang.Exception

save

public void save(java.io.Serializable key,
                 java.io.Serializable val)
          throws CannotPersistException
Save new NV pair as serializable objects or if already exist; store new state

Specified by:
save in interface PersistenceManager
Throws:
CannotPersistException;
CannotPersistException

remove

public java.io.Serializable remove(java.io.Serializable key)
                            throws CannotRemoveException
Used to remove existing entry

Specified by:
remove in interface PersistenceManager
Returns:
Serializable; value
Throws:
CannotRemoveException;
CannotRemoveException

saveAll

public void saveAll(java.util.Map map)
             throws CannotPersistException
Used to save all row entries for the map in to DB

Specified by:
saveAll in interface PersistenceManager
Throws:
CannotPersistException;
CannotPersistException

retrieveAll

public java.util.Map retrieveAll()
                          throws CannotRetrieveException
Used to retrieve the persisted map back to its last known state

Specified by:
retrieveAll in interface PersistenceManager
Returns:
Map;
Throws:
CannotRetrieveException;
CannotRetrieveException

clear

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

Specified by:
clear in interface PersistenceManager
Throws:
CannotRemoveException;
CannotRemoveException

shutDown

public void shutDown()
Shutting down the database cleanly

Specified by:
shutDown in interface PersistenceManager


Copyright ? 2001,2002 www.javagroups.com . All Rights Reserved.