|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Holds all the available registered Persisters in the IVC. This is the only way to find out which Persisters are available in the system and hence all Persisters must be registered with this registry. It is strongly recommended that all users of the persistence layer use this registry instead of trying to use the persisters directly. It may happen that several persisters are capable of persistence for a given ResourceDescriptor or a given data model. In this case, its up to the implementation to decide which persister to use. User interfaces systems that have the capability of taking user input and giving feedback should use the registry to get a list of available persisters for a specified data model or resource descriptor and let the user choose which one to use. Applications are expected to use the PersistenceRegistry and offload the decision making onto the user.
| Method Summary | |
Persister |
findPersister(java.lang.Object model,
ResourceDescriptor resource)
Finds a persister that can persist a specified data model to a specified data resource or one that can restore from a particular resource. |
java.util.List |
getPersisters()
Gets the list of all persisters currently registered with the registry. |
java.util.List |
getSupportingPersisters(java.lang.Object model)
Returns the list of persisters that can persist the specified data model. |
java.util.List |
getSupportingPersisters(ResourceDescriptor source)
Returns the list of persisters that can restore from the specified data resource. |
java.lang.Object |
load(ResourceDescriptor source)
Loads the given data model from the given resource. |
void |
register(Persister persister)
Registers the persister with the registry. |
void |
save(java.lang.Object model,
ResourceDescriptor destination)
Saves a model to a data resource such as a file or a database. |
| Method Detail |
public void register(Persister persister)
persister - The persister to add to the registry.public java.util.List getSupportingPersisters(java.lang.Object model)
model - The data model for which persistence is desired.
Persister,
save(Object, ResourceDescriptor),
PersisterNotFoundExceptionpublic java.util.List getSupportingPersisters(ResourceDescriptor source)
source - The data source from which the data model needs to be restored.
Persister,
load(ResourceDescriptor),
PersisterNotFoundExceptionpublic java.util.List getPersisters()
public Persister findPersister(java.lang.Object model,
ResourceDescriptor resource)
model - The data model that needs to be persisted or restored.resource - The resource to which this data needs to be persisted to or restored
from.
public void save(java.lang.Object model,
ResourceDescriptor destination)
throws java.io.IOException,
PersistenceException
model - The model to be saved.destination - The object describing the properties of the data resource
where this model should be saved.
java.io.IOException
PersistenceException
public java.lang.Object load(ResourceDescriptor source)
throws java.io.IOException,
java.lang.OutOfMemoryError,
PersistenceException
source - The resource from where the data model is to be loaded.
PersisterNotFoundException
java.io.IOException
java.lang.OutOfMemoryError
PersistenceExceptionPersisterNotFoundException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||