|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface MergeHandler
Monitors serialization and deserialization by PersistenceStore for
update conflict events, and handles the conflicts when they are detected.
A MergeHandler is given modification stamps (long integers) that
increment by at least 1 every time an object is modified (modification times
on filesystems may be given). Filesystem implementations could use the
modification time (in milliseconds).
PersistenceStore| Method Summary | |
|---|---|
java.lang.Object |
merge(java.lang.Object storedObject,
java.lang.Object latestObject)
Invoked by PersistenceStore when a write conflict is detected to
merge the two objects into a new object that will be stored. |
boolean |
needsMerge(java.lang.String itemName,
long modificationStamp)
Tests whether the given item needs merged with the item in storage that has the given modificationStamp. |
void |
updateModificationStampAfterRetrieve(java.lang.String itemName,
long modificationStamp)
Updates the handler's modification stamp for the item immediately after the it was read from storage. |
void |
updateModificationStampAfterStore(java.lang.String itemName,
long modificationStamp)
Updates the handler's modification stamp for the item immediately after it was saved to storage. |
| Method Detail |
|---|
void updateModificationStampAfterStore(java.lang.String itemName,
long modificationStamp)
itemName - the name of the item just written (must not be null
or empty)modificationStamp - the modification number of the object after it was just written
void updateModificationStampAfterRetrieve(java.lang.String itemName,
long modificationStamp)
itemName - the name of the item just read (must not be null or
empty)modificationStamp - the modification number of the object after it was just read
boolean needsMerge(java.lang.String itemName,
long modificationStamp)
itemName - the name of the item being tested (must not be null
or empty)modificationStamp - the modification number of the object after it exists in storage
now (before it is read)
java.lang.Object merge(java.lang.Object storedObject,
java.lang.Object latestObject)
PersistenceStore when a write conflict is detected to
merge the two objects into a new object that will be stored. An
implementation is free to return one of the given objects, or to return a
new object.
storedObject - the object currently in storage (must not be null)latestObject - the latest object not yet stored (must not be null)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||