org.oddjob.persist
Class MapPersister

java.lang.Object
  extended by org.oddjob.persist.PersisterBase
      extended by org.oddjob.persist.MapPersister
All Implemented Interfaces:
OddjobPersister

public class MapPersister
extends PersisterBase


Constructor Summary
MapPersister()
           
MapPersister(Map<Path,Map<String,byte[]>> store)
           
 
Method Summary
protected  void clear(Path path)
          Remove a possibly previously persisted object.
protected  String[] list(Path path)
           
protected  void persist(Path path, String id, Object proxy)
          Provided by subclasses to do the persisting.
protected  void remove(Path path, String id)
          Remove a possibly previously persisted object.
protected  Object restore(Path path, String id, ClassLoader classLoader)
          Restore a previously persisted Component or it's Proxy.
 String toString()
           
 
Methods inherited from class org.oddjob.persist.PersisterBase
persisterFor, setPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MapPersister

public MapPersister()

MapPersister

public MapPersister(Map<Path,Map<String,byte[]>> store)
Method Detail

persist

protected void persist(Path path,
                       String id,
                       Object proxy)
Description copied from class: PersisterBase
Provided by subclasses to do the persisting.

Specified by:
persist in class PersisterBase
Parameters:
path - The path as a string. Never null.
id - The id. Never Null.
proxy - The component or it's proxy.

restore

protected Object restore(Path path,
                         String id,
                         ClassLoader classLoader)
Description copied from class: PersisterBase
Restore a previously persisted Component or it's Proxy.

Specified by:
restore in class PersisterBase
Parameters:
path - The path. Never Null.
id - The id. Never Null.
classLoader - The classLoader.
Returns:
The component or it's proxy. Null if nothing had previously been persisted for this path and id.

list

protected String[] list(Path path)
                 throws ComponentPersistException
Specified by:
list in class PersisterBase
Throws:
ComponentPersistException

remove

protected void remove(Path path,
                      String id)
Description copied from class: PersisterBase
Remove a possibly previously persisted object.

Specified by:
remove in class PersisterBase
Parameters:
path - The path.
id - The id.

clear

protected void clear(Path path)
Description copied from class: PersisterBase
Remove a possibly previously persisted object.

Specified by:
clear in class PersisterBase
Parameters:
path - The path.

toString

public String toString()
Overrides:
toString in class Object