org.oddjob.arooa.life
Interface ComponentPersister


public interface ComponentPersister

Something capable of persisting a component. The Object passed is the proxy not the underlying component.

Author:
rob

Method Summary
 void clear()
          Clear this persister of everything stored.
 void close()
          Free resources used by the implementation.
 String[] list()
          List the persisted components.
 void persist(String id, Object proxy, ArooaSession session)
          Persist the proxy Object.
 void remove(String id, ArooaSession session)
          Remove an object from the store.
 Object restore(String id, ClassLoader classLoader, ArooaSession session)
          Restore the proxy Object.
 

Method Detail

persist

void persist(String id,
             Object proxy,
             ArooaSession session)
             throws ComponentPersistException
Persist the proxy Object.

The id is given although it could be discovered from the ComponentPool in the ArooaSession. This is for symmetry with the other methods of this interface.

Parameters:
id - The id for proxy.
proxy - The object to persist.
session - The session.
Throws:
ComponentPersistException

restore

Object restore(String id,
               ClassLoader classLoader,
               ArooaSession session)
               throws ComponentPersistException
Restore the proxy Object.

Parameters:
id - The id.
session - The session.
Returns:
The restored object.
Throws:
ComponentPersistException

remove

void remove(String id,
            ArooaSession session)
            throws ComponentPersistException
Remove an object from the store.

Parameters:
id -
session -
Throws:
ComponentPersistException

list

String[] list()
              throws ComponentPersistException
List the persisted components.

Returns:
The ids of the persisted components.
Throws:
ComponentPersistException

clear

void clear()
           throws ComponentPersistException
Clear this persister of everything stored.

Throws:
ComponentPersistException

close

void close()
Free resources used by the implementation.