|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuka.patch.PatchAdapter
Monitors an arbitrary patchable object for
changes. A patch adapter can be used to create a patch from a
changed object and apply this patch to a patch adapter of a
corresponding object to redo the same changes to the second object.
| Constructor Summary | |
PatchAdapter()
|
|
| Method Summary | |
abstract void |
applyPatch(PatchReader reader)
Applies a patch read from the passed input stream to the own monitored object. |
abstract void |
createPatch(AbstractPatchWriter writer)
|
abstract AbstractPatchWriter |
createPatch(MarshalStream marshal)
Compares the monitored object of this patch adapter with its backup copy. |
abstract PatchReader |
createPatchReader(UnmarshalStream in)
|
abstract ObjectSpace |
getObjectSpace()
Returns the object space of original objects. |
abstract java.lang.Object |
getRoot()
|
static PatchAdapter |
newInstance(java.lang.Object root)
Creates a new patch adapter for the specified object. |
abstract void |
updateAfterApplyPatch()
|
abstract void |
updateAfterCreatePatch()
|
abstract void |
updateAfterDistributionUpdate()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PatchAdapter()
| Method Detail |
public static PatchAdapter newInstance(java.lang.Object root)
throws java.io.IOException
Creates a new patch adapter for the specified object. Changes
that are made to the monitored object after the patch adapter
is created result in a non-empty patch, when createPatch(MarshalStream) is called. For monitoring changes
to an object, the patch adapter internally creates a backup
copy of the specified object. During patch creation, the
original object is compared with the backup copy.
The passed object and all its referenced objects (object in
the transitive hull of the reference relation) must either
implement the Patchable interface, or a PatchDescriptor must exist for the object's class.
java.io.IOExceptionpublic abstract ObjectSpace getObjectSpace()
AbstractPatchWriterpublic abstract java.lang.Object getRoot()
newInstance(Object).
public abstract AbstractPatchWriter createPatch(MarshalStream marshal)
throws java.io.IOException
Compares the monitored object of this patch adapter with its
backup copy. The result of the comparison is written to the
output stream. Each difference of the original and the backup
copy results in a patch record written to the stream. During
patch creation, the backup copy is concurrently updated to the
current state of the monitored object. When applying createPatch(MarshalStream) twice without modifying the
monitored object in between, then the second patch that is
created will be the empty patch.
The patch data written to the output stream can be passed to
the applyPatch(PatchReader) method of another patch
adapter that monitors a corresponding object for applying the
patch to this object. A patch adapter that monitors a
corresponding object can be created by marshaling this patch
adapter in a remote method invocation to another computer, or
by deeply cloning this patch adapter. Especially, one can
not create a second patch adapter using newInstance(Object) and pass another object of the same class
as this patch adapter's monitored object. Such two patch
adapters are out of synch and cannot apply each others
patches.
marshal - the stream, the patch is written to.
java.io.IOExceptionDeepClone
public abstract void createPatch(AbstractPatchWriter writer)
throws java.io.IOException
java.io.IOException
public abstract void updateAfterCreatePatch()
throws java.io.IOException
java.io.IOException
public abstract void updateAfterDistributionUpdate()
throws java.io.IOException
java.io.IOException
public abstract void updateAfterApplyPatch()
throws java.io.IOException
java.io.IOException
public abstract PatchReader createPatchReader(UnmarshalStream in)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public abstract void applyPatch(PatchReader reader)
throws java.io.IOException,
java.lang.ClassNotFoundException
createPatch(MarshalStream).
java.io.IOException
java.lang.ClassNotFoundException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||