|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface WabitPersister
An interface for objects that persist WabitObjects. The medium into
which they are persisted is entirely up to the implementation.
| Nested Class Summary | |
|---|---|
static class |
WabitPersister.DataType
Defines each type of object that can be persisted by the WabitPersister. |
static class |
WabitPersister.WabitPersistMethod
An enumeration of possible WabitPersister commands. |
| Method Summary | |
|---|---|
void |
begin()
Indicates the start of an atomic transaction of persisting multiple WabitObjects. |
void |
commit()
Causes a current WabitObject persistence transaction to commit
its results. |
void |
persistObject(java.lang.String parentUUID,
java.lang.String type,
java.lang.String uuid,
int index)
Adds a WabitObject into the persistent storage. |
void |
persistProperty(java.lang.String uuid,
java.lang.String propertyName,
WabitPersister.DataType propertyType,
java.lang.Object newValue)
Modifies the named property of the specified WabitObject in this persister's workspace. |
void |
persistProperty(java.lang.String uuid,
java.lang.String propertyName,
WabitPersister.DataType propertyType,
java.lang.Object oldValue,
java.lang.Object newValue)
Modifies the named property of the specified WabitObject in this persister's workspace. |
void |
removeObject(java.lang.String parentUUID,
java.lang.String uuid)
Removes a WabitObject from persistent storage |
void |
rollback()
Restores the persisted WabitObject back to the state it was in before the transaction began (i.e. |
| Method Detail |
|---|
void persistProperty(java.lang.String uuid,
java.lang.String propertyName,
WabitPersister.DataType propertyType,
java.lang.Object oldValue,
java.lang.Object newValue)
throws WabitPersistenceException
Exception if the actual
previous value in persistent storage does not match the expected previous
value as an indication to the object using this WabitPersister that their
cached copy of the WabitObject may be out of sync with the
persistent storage.
uuid - The UUID of the WabitObject in which to set the
propertypropertyName - The JavaBeans property name of the property that changed, as
it would be discovered by the java.beans.Introspector classpropertyType - The type, and Java representation, of this propertyoldValue - The expected previous value of the propertynewValue - The new value to set for the property
WabitPersistenceException - A general Exception that is thrown if any Exception occurs
while persisting the property. It can be used to wrap the
specific cause Exception and provide other details like the
WabitObject UUID. Some potential exceptional situations
include:
void persistProperty(java.lang.String uuid,
java.lang.String propertyName,
WabitPersister.DataType propertyType,
java.lang.Object newValue)
throws WabitPersistenceException
WabitObjects stay in synch, this method should only be called by
the Persister representing the master copy of the WabitObject.
uuid - The UUID of the WabitObject in which to set the
propertypropertyName - The JavaBeans property name of the property that changed, as
it would be discovered by the java.beans.Introspector classpropertyType - The type, and Java representation, of this propertynewValue - The new value to set for the property
WabitPersistenceException - A general Exception that is thrown if any Exception occurs
while persisting the property. It can be used to wrap the
specific cause Exception and provide other details like the
WabitObject UUID. Some potential exceptional situations
include:
void persistObject(java.lang.String parentUUID,
java.lang.String type,
java.lang.String uuid,
int index)
throws WabitPersistenceException
WabitObject into the persistent storage. If the
WabitObject already exists in persistent storage, then it will throw an
exception Note that this will not persist its properties or any child
objects.
parentUUID - The UUID of the parent WabitObject of the object to
persist. If the WabitObject has no parent (as is the case for
WabitWorkspace), then it can be set to null.type - A String of the class name of the WabitObject to be persisted
(ex. WabitWorkspace)uuid - The UUID of the WabitObject to actually persistindex - The index of the WabitObject in its parents' list of children
WabitPersistenceException - A general Exception that is thrown if any Exception occurs
while persisting the WabitObject. It can be used to wrap the
specific cause Exception and provide other details like the
WabitObject UUID. Some potential exceptional situations
include:
void removeObject(java.lang.String parentUUID,
java.lang.String uuid)
throws WabitPersistenceException
parentUUID - The UUID of the parent WabitObject of the object to
removeuuid - The UUID of the WabitObject to remove
WabitPersistenceException - A general Exception that is thrown if any Exception occurs
while persisting the WabitObject. It can be used to wrap the
specific cause Exception and provide other details like the
WabitObject UUID.
void begin()
throws WabitPersistenceException
WabitObjects. To be used with a paired call to commit()
WabitPersistenceException - A general Exception that is thrown if any Exception occurs
while persisting the WabitObject. It can be used to wrap the
specific cause Exception and provide other details like the
WabitObject UUID.
void commit()
throws WabitPersistenceException
WabitObject persistence transaction to commit
its results.
WabitPersistenceException - A general Exception that is thrown if any Exception occurs
while committing the transaction. This could be caused by one
being thrown by #persistObject(String, String),
#persistProperty(String, String, Object, Object), or
removeObject(String, String). Some other exceptional
situations include:
void rollback()
begin() was made).
Typically, this would be called if an exception occurs during an atomic
transaction. In the event that a rollback() is called within a nested
transaction (that is, a begin() call after another begin() call before
commit()), then the state of the WabitObjects must be rolled back to the
state they were in before the highest level transaction began.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||