|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
This interface is realized by model objects that have the capability to synchronize its state. Its used in XMA to synchronize a client and its server side instance of a widget model.
The methods in this interface work much like Java-serialization. Basically, state is saved in a byte stream (externalize) and may be restored from there (internalize).
This interface works in close relationship with Transactional. An implementing class may decide not to store its complete state in externalize, but only to store changes since the last syncpoint (see Transactional).
| Method Summary | |
void |
externalize(XmaOutput xo,
boolean forceFull)
Externalizing either saves the actual state or deltas (changes) in a provided XMAObjectOutput. |
void |
internalize(XmaInput in)
Updates the state of this with information of the given XMAObjectInput. |
| Method Detail |
public void externalize(XmaOutput xo,
boolean forceFull)
throws java.io.IOException
If forceFull is false, the object implementing this interface must also implement Transactional. If the object implementing this is able to track changes, these are the changes since the last syncpoint.
xo - the serialization destinationforceFull - if true, the complete state is written
and deltas are ignored.
java.io.IOException - on serialization errors
public void internalize(XmaInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
This method is not allowed to throw Exceptions because that would leave models in an inconsistent state. Thrown exceptions are considered to be programming errors. Internalize must not throw technical exceptions which indicate system or ressource failures. That implies that the person implementing internalize is not allowed to access ressources outside the JVM, either directly or via calls to other methods. Examples of ressource access which must not be triggered are calls to communication of file system services.
in - the XMAObjectInput. If a XMAObjectInputChangeListener is
set in the object in, it will be notified after applying
changes read from in.
java.io.IOException - on serialization errors
java.lang.ClassNotFoundException - on serialization errors
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||