uka.patch
Interface PatchOutput

All Known Implementing Classes:
PatchAdapterImpl.Output

public interface PatchOutput

Inferface for creating object patches in an abstract way. An object implementing PatchOutput is used as target in the Patchable.createPatch(Object, PatchOutput) method of a patchable object. The patchable object calls the corresponding writeDiff(int, int) method for each of its instance variables and passes the corresponding value from its backup copy as second parameter.


Method Summary
 void createPatchAnonymous(java.lang.Object r, java.lang.Object c)
           
 MarshalStream getOutput(int rank)
          Experimental low-level API: Patch creation for the expert.
 boolean writeDiff(boolean v, boolean c)
           
 boolean writeDiff(byte v, byte c)
           
 boolean writeDiff(char v, char c)
           
 boolean writeDiff(double v, double c)
           
 boolean writeDiff(float v, float c)
           
 boolean writeDiff(int v, int c)
           
 boolean writeDiff(long v, long c)
           
 java.lang.Object writeDiff(java.lang.Object r, java.lang.Object c)
          Like writeDiff(int, int) for instance variables of reference type.
 boolean writeDiff(short v, short c)
           
 

Method Detail

writeDiff

public boolean writeDiff(boolean v,
                         boolean c)
                  throws java.io.IOException
Throws:
java.io.IOException
See Also:
writeDiff(int, int)

writeDiff

public boolean writeDiff(byte v,
                         byte c)
                  throws java.io.IOException
Throws:
java.io.IOException
See Also:
writeDiff(int, int)

writeDiff

public boolean writeDiff(char v,
                         char c)
                  throws java.io.IOException
Throws:
java.io.IOException
See Also:
writeDiff(int, int)

writeDiff

public boolean writeDiff(short v,
                         short c)
                  throws java.io.IOException
Throws:
java.io.IOException
See Also:
writeDiff(int, int)

writeDiff

public boolean writeDiff(int v,
                         int c)
                  throws java.io.IOException
Parameters:
v - the value of currently inspected instance variable of a patchable object.
c - the value of the corresponding instance variable of the backup copy.
Returns:
whether a difference was detected and a patch record was written. If there is a difference, the instance variable of the backup copy needs to be updated to the current value.
Throws:
java.io.IOException

writeDiff

public boolean writeDiff(float v,
                         float c)
                  throws java.io.IOException
Throws:
java.io.IOException
See Also:
writeDiff(int, int)

writeDiff

public boolean writeDiff(long v,
                         long c)
                  throws java.io.IOException
Throws:
java.io.IOException
See Also:
writeDiff(int, int)

writeDiff

public boolean writeDiff(double v,
                         double c)
                  throws java.io.IOException
Throws:
java.io.IOException
See Also:
writeDiff(int, int)

writeDiff

public java.lang.Object writeDiff(java.lang.Object r,
                                  java.lang.Object c)
                           throws java.io.IOException
Like writeDiff(int, int) for instance variables of reference type. But instead of a modification notification the new reference (normally the one that was passed as first argument) is returned. In case of partial replication, there is an exception to that rule: If the application has decided not to replicate an object on the node, where it was created on, the reference is deleted during update. In that case, this method will return null insted. The responsibility of the Patchable.createPatch(Object, PatchOutput) method is to assign the returned reference to the corresponding instance variables of the original and the backup copy.

Returns:
the value of parameter r, or null, if r is not being replicated on the local node.
Throws:
java.io.IOException
See Also:
writeDiff(int, int)

createPatchAnonymous

public void createPatchAnonymous(java.lang.Object r,
                                 java.lang.Object c)
                          throws java.io.IOException
Throws:
java.io.IOException

getOutput

public MarshalStream getOutput(int rank)
                        throws java.io.IOException
Experimental low-level API: Patch creation for the expert.

Throws:
java.io.IOException