public class MapPersister extends PersisterBase
OddjobPersister
.Constructor and Description |
---|
MapPersister()
Create a new instance with a standard
HashMap . |
MapPersister(Map<Path,Map<String,byte[]>> store)
Create a new instance with the provided map.
|
Modifier and Type | Method and Description |
---|---|
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() |
persisterFor, setPath
public MapPersister()
HashMap
.protected void persist(Path path, String id, Object proxy)
PersisterBase
persist
in class PersisterBase
path
- The path as a string. Never null.id
- The id. Never Null.proxy
- The component or it's proxy.protected Object restore(Path path, String id, ClassLoader classLoader)
PersisterBase
restore
in class PersisterBase
path
- The path. Never Null.id
- The id. Never Null.classLoader
- The classLoader.protected String[] list(Path path) throws ComponentPersistException
list
in class PersisterBase
ComponentPersistException
protected void remove(Path path, String id)
PersisterBase
remove
in class PersisterBase
path
- The path.id
- The id.protected void clear(Path path)
PersisterBase
clear
in class PersisterBase
path
- The path.