X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.structural.synchronization%2Fsrc%2Forg%2Fsimantics%2Fstructural%2Fsynchronization%2Fprotocol%2FSynchronizationEventHandler.java;fp=bundles%2Forg.simantics.structural.synchronization%2Fsrc%2Forg%2Fsimantics%2Fstructural%2Fsynchronization%2Fprotocol%2FSynchronizationEventHandler.java;h=f6b9ce3f5f1a977aade58c215405b4e596066a25;hp=0a468e42ace5dd5a75503c858cfa3272a5c0a24f;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/protocol/SynchronizationEventHandler.java b/bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/protocol/SynchronizationEventHandler.java index 0a468e42a..f6b9ce3f5 100644 --- a/bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/protocol/SynchronizationEventHandler.java +++ b/bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/protocol/SynchronizationEventHandler.java @@ -1,57 +1,57 @@ -package org.simantics.structural.synchronization.protocol; - -import java.util.Collection; - -/** - * Communicates synchronization events from the synchronizer - * browsing variable structure to the simulator. - * - * TODO: - * - which properties available in the variable are sent (based on classification) - * - what to do when resource ids change (export/import) - */ -public interface SynchronizationEventHandler { - - - /** - * Called at the beginning of synchronization. All other - * methods must be called between beginSynchronization/endSynchronization pair. - */ - void beginSynchronization(); - - /** - * Called at the end of synchronization. - */ - void endSynchronization(); - - /** - * Describes a component - */ - void beginComponent( - String name, - String typeId, - Collection properties, - Collection connections, - Collection children) throws SynchronizationException; - - void endComponent(); - - /* - * TODO: maybe we require that whenever a type is updated all its instances are also updated - */ - void beginType( - String id, - Collection properties) throws SynchronizationException; - void endType(); - - void reportProblem(String description); - - void reportProblem(String description, Exception e); - - /** - * Called when an error happens during synchronization that prevents its continuation. - * Returns true, if the handler was able to fix the state of the mapping. If false, - * the current state is unusable and should be discarded. - */ - //boolean cleanUpAfterSynchronizationFailure(); -} +package org.simantics.structural.synchronization.protocol; + +import java.util.Collection; + +/** + * Communicates synchronization events from the synchronizer + * browsing variable structure to the simulator. + * + * TODO: + * - which properties available in the variable are sent (based on classification) + * - what to do when resource ids change (export/import) + */ +public interface SynchronizationEventHandler { + + + /** + * Called at the beginning of synchronization. All other + * methods must be called between beginSynchronization/endSynchronization pair. + */ + void beginSynchronization(); + + /** + * Called at the end of synchronization. + */ + void endSynchronization(); + + /** + * Describes a component + */ + void beginComponent( + String name, + String typeId, + Collection properties, + Collection connections, + Collection children) throws SynchronizationException; + + void endComponent(); + + /* + * TODO: maybe we require that whenever a type is updated all its instances are also updated + */ + void beginType( + String id, + Collection properties) throws SynchronizationException; + void endType(); + + void reportProblem(String description); + + void reportProblem(String description, Exception e); + + /** + * Called when an error happens during synchronization that prevents its continuation. + * Returns true, if the handler was able to fix the state of the mapping. If false, + * the current state is unusable and should be discarded. + */ + //boolean cleanUpAfterSynchronizationFailure(); +}