1 package org.simantics.structural.synchronization.protocol;
\r
3 import java.util.Collection;
\r
6 * Communicates synchronization events from the synchronizer
\r
7 * browsing variable structure to the simulator.
\r
10 * - which properties available in the variable are sent (based on classification)
\r
11 * - what to do when resource ids change (export/import)
\r
13 public interface SynchronizationEventHandler {
\r
17 * Called at the beginning of synchronization. All other
\r
18 * methods must be called between beginSynchronization/endSynchronization pair.
\r
20 void beginSynchronization();
\r
23 * Called at the end of synchronization.
\r
25 void endSynchronization();
\r
28 * Describes a component
\r
30 void beginComponent(
\r
33 Collection<SerializedVariable> properties,
\r
34 Collection<Connection> connections,
\r
35 Collection<ChildInfo> children) throws SynchronizationException;
\r
37 void endComponent();
\r
40 * TODO: maybe we require that whenever a type is updated all its instances are also updated
\r
44 Collection<SerializedVariable> properties) throws SynchronizationException;
\r
47 void reportProblem(String description);
\r
49 void reportProblem(String description, Exception e);
\r
52 * Called when an error happens during synchronization that prevents its continuation.
\r
53 * Returns true, if the handler was able to fix the state of the mapping. If false,
\r
54 * the current state is unusable and should be discarded.
\r
56 //boolean cleanUpAfterSynchronizationFailure();
\r