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