Package org.oddjob.persist
Class PersisterBase
java.lang.Object
org.oddjob.persist.PersisterBase
- All Implemented Interfaces:
OddjobPersister
- Direct Known Subclasses:
FilePersister,MapPersister
- Author:
- Rob Gordon
Description
This provides common implementation for persisting job state.-
Constructor Summary
ConstructorsModifierConstructorDescriptionConstructor.protectedPersisterBase(Path path) Constructor used for nested persisters. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidRemove a possibly previously persisted object.protected abstract String[]protected abstract voidProvided by subclasses to do the persisting.persisterFor(String id) Provide a ComponentPersiter which may or may not require the id.protected abstract voidRemove a possibly previously persisted object.protected abstract Objectrestore(Path path, String id, ClassLoader classLoader) Restore a previously persisted Component or it's Proxy.void
-
Constructor Details
-
PersisterBase
public PersisterBase()Constructor. -
PersisterBase
Constructor used for nested persisters.- Parameters:
path- The path.
-
-
Method Details
-
setPath
-
persisterFor
Description copied from interface:OddjobPersisterProvide a ComponentPersiter which may or may not require the id. If an id is required but not provided null will be returned.- Specified by:
persisterForin interfaceOddjobPersister- Parameters:
id- An Id which may be used for a path. May be Null.- Returns:
- A ComponentPersister. May be null.
-
persist
protected abstract void persist(Path path, String id, Object component) throws ComponentPersistException Provided by subclasses to do the persisting.- Parameters:
path- The path as a string. Never null.id- The id. Never Null.component- The component or it's proxy.- Throws:
ComponentPersistException
-
restore
protected abstract Object restore(Path path, String id, ClassLoader classLoader) throws ComponentPersistException Restore a previously persisted Component or it's Proxy.- 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.
- Throws:
ComponentPersistException
-
list
- Throws:
ComponentPersistException
-
remove
Remove a possibly previously persisted object.- Parameters:
path- The path.id- The id.- Throws:
ComponentPersistException
-
clear
Remove a possibly previously persisted object.- Parameters:
path- The path.id- The id.- Throws:
ComponentPersistException
-