]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Separate DB and non-DB code to different structural sync bundles 66/2466/5
authorAntti Villberg <antti.villberg@semantum.fi>
Fri, 16 Nov 2018 13:11:00 +0000 (15:11 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 20 Nov 2018 06:53:39 +0000 (06:53 +0000)
Previously, code in org.simantics.structural.synchronization.client was
in packages that were dangerously named
org.simantics.structural.synchronization, which could easily escalate
into split packages between bundles with more of such sloppy naming.

This moves the whole org.simantics.structural.synchronization.base
package from .structural.synchronization.client to
.structural.synchronization which changes nothing from the bundle user's
point of view. Code that stays in .structural.synchronization.client is
moved into the org.simantics.structural.synchronization.client package
to keep things cleaners.

gitlab #206

Change-Id: I2366b6e7395750cc9b6649abd3e77ef1661d2d1f

21 files changed:
bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/SpreadsheetGraphUtils.java
bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/SpreadsheetSessionManager.java
bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/synchronization/LineUpdater.java
bundles/org.simantics.structural.synchronization.client/META-INF/MANIFEST.MF
bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/client/ContinuousSynchronizationJob.java [moved from bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/ContinuousSynchronizationJob.java with 97% similarity]
bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/client/StructuralChangeFlattener.java [moved from bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/StructuralChangeFlattener.java with 99% similarity]
bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/client/Synchronizer.java [moved from bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/Synchronizer.java with 99% similarity]
bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/client/UpdateComponentUids.java [moved from bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/UpdateComponentUids.java with 98% similarity]
bundles/org.simantics.structural.synchronization/META-INF/MANIFEST.MF
bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/base/CommandBuilder.java [moved from bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/CommandBuilder.java with 100% similarity]
bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/base/ConnectionUpdateRule.java [moved from bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/ConnectionUpdateRule.java with 100% similarity]
bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/base/ModuleCallback.java [moved from bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/ModuleCallback.java with 100% similarity]
bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/base/ModuleUpdateContext.java [moved from bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/ModuleUpdateContext.java with 100% similarity]
bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/base/ModuleUpdaterBase.java [moved from bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/ModuleUpdaterBase.java with 100% similarity]
bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/base/ModuleUpdaterFactoryBase.java [moved from bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/ModuleUpdaterFactoryBase.java with 78% similarity]
bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/base/PropertyUpdateRule.java [moved from bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/PropertyUpdateRule.java with 100% similarity]
bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/base/ReferenceResolverBase.java [moved from bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/ReferenceResolverBase.java with 100% similarity]
bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/base/SolverNameUtil.java [moved from bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/SolverNameUtil.java with 100% similarity]
bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/base/SynchronizationEventHandlerBase.java [moved from bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/SynchronizationEventHandlerBase.java with 99% similarity]
bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/internal/Policy.java [moved from bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/internal/Policy.java with 100% similarity]
bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/protocol/AbstractSynchronizationEventHandler.java [moved from bundles/org.simantics.structural.synchronization/src/org/simantics/structural/synchronization/base2/AbstractSynchronizationEventHandler.java with 96% similarity]

index 297ac9dc9fffe17f2afd48fdd6d4dd9b0913e879..032acfcfce722809848b8fceeeac10bb9bd19800 100644 (file)
@@ -38,7 +38,7 @@ import org.simantics.spreadsheet.Range;
 import org.simantics.spreadsheet.graph.synchronization.SpreadsheetSynchronizationEventHandler;
 import org.simantics.spreadsheet.resource.SpreadsheetResource;
 import org.simantics.spreadsheet.util.SpreadsheetUtils;
-import org.simantics.structural.synchronization.Synchronizer;
+import org.simantics.structural.synchronization.client.Synchronizer;
 
 import gnu.trove.iterator.TObjectIntIterator;
 import gnu.trove.map.hash.TObjectIntHashMap;
index f50463ef009f93d55bdf4dc74375c44b57d656cf..ec8935f285ced8713f9614c9fca87f6ecdce9329 100644 (file)
@@ -23,7 +23,7 @@ import org.simantics.simulator.toolkit.db.StandardVariableSessionManager;
 import org.simantics.spreadsheet.graph.formula.SpreadsheetEvaluationEnvironment;
 import org.simantics.spreadsheet.graph.synchronization.SpreadsheetSynchronizationEventHandler;
 import org.simantics.spreadsheet.resource.SpreadsheetResource;
-import org.simantics.structural.synchronization.Synchronizer;
+import org.simantics.structural.synchronization.client.Synchronizer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index baa0851b2503006182b9cb53cc055329cfdc8fe1..18f0bfbc5da7ec20225c7d097a47042c45527447 100644 (file)
@@ -10,7 +10,6 @@ import org.simantics.structural.synchronization.base.CommandBuilder;
 import org.simantics.structural.synchronization.base.ModuleUpdateContext;
 import org.simantics.structural.synchronization.base.ModuleUpdaterBase;
 import org.simantics.structural.synchronization.base.PropertyUpdateRule;
-import org.simantics.structural.synchronization.utils.Solver;
 
 public class LineUpdater extends ModuleUpdaterBase<SheetLineComponent> {
        
index 6fe0a79e03f0419884ee264600c5259cbc6a3075..ba77d3e370a8e9a69b6211e0251f42b932fae8e8 100644 (file)
@@ -13,6 +13,5 @@ Require-Bundle: org.simantics.databoard;bundle-version="0.6.5",
  org.simantics.datatypes.ontology;bundle-version="1.1.0",
  org.simantics.structural.synchronization;bundle-version="1.0.0";visibility:=reexport,
  org.slf4j.api
-Export-Package: org.simantics.structural.synchronization,
- org.simantics.structural.synchronization.base
+Export-Package: org.simantics.structural.synchronization.client
 Automatic-Module-Name: org.simantics.structural.synchronization.client
index 63d4a68326133b93bdade3b2ef1956229677a254..5cf82d1f1d3a89772c2a760ed22c91c61c016a97 100644 (file)
@@ -4,7 +4,7 @@ Bundle-Name: Synchronization
 Bundle-SymbolicName: org.simantics.structural.synchronization;singleton:=true
 Bundle-Version: 1.0.0.qualifier
 Bundle-RequiredExecutionEnvironment: JavaSE-1.8
-Export-Package: org.simantics.structural.synchronization.base2,
+Export-Package: org.simantics.structural.synchronization.base,
  org.simantics.structural.synchronization.protocol,
  org.simantics.structural.synchronization.utils
 Require-Bundle: org.simantics.databoard;bundle-version="0.6.5",
@@ -1,13 +1,13 @@
 package org.simantics.structural.synchronization.base;
 
-import gnu.trove.map.hash.THashMap;
-
 import java.util.ArrayList;
 
 import org.simantics.databoard.binding.mutable.Variant;
 import org.simantics.structural.synchronization.utils.ComponentBase;
 import org.simantics.structural.synchronization.utils.Solver;
 
+import gnu.trove.map.hash.THashMap;
+
 public class ModuleUpdateContext<T extends ComponentBase<T>> {
 
     private ModuleUpdaterBase<T> updater;
@@ -1,7 +1,5 @@
 package org.simantics.structural.synchronization.base;
 
-import gnu.trove.map.hash.THashMap;
-
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Map;
@@ -11,6 +9,8 @@ import org.simantics.structural.synchronization.protocol.Connection;
 import org.simantics.structural.synchronization.protocol.SerializedVariable;
 import org.simantics.structural.synchronization.utils.ComponentBase;
 
+import gnu.trove.map.hash.THashMap;
+
 abstract public class ModuleUpdaterBase<T extends ComponentBase<T>> {
 
     public String moduleType;
@@ -1,11 +1,9 @@
 package org.simantics.structural.synchronization.base;
 
-import org.simantics.db.exception.DatabaseException;
 import org.simantics.structural.synchronization.utils.ComponentBase;
 
-
 public interface ModuleUpdaterFactoryBase<T extends ComponentBase<T>> {
 
-    public ModuleUpdaterBase<T> createUpdater(String id) throws DatabaseException;
+    public ModuleUpdaterBase<T> createUpdater(String id) throws Exception;
 
 }
@@ -1,8 +1,5 @@
 package org.simantics.structural.synchronization.base;
 
-import gnu.trove.map.hash.THashMap;
-import gnu.trove.procedure.TObjectObjectProcedure;
-
 import java.util.ArrayList;
 import java.util.Collections;
 
@@ -12,6 +9,9 @@ import org.simantics.structural.synchronization.utils.ComponentBase;
 import org.simantics.structural.synchronization.utils.Solver;
 import org.slf4j.Logger;
 
+import gnu.trove.map.hash.THashMap;
+import gnu.trove.procedure.TObjectObjectProcedure;
+
 abstract public class ReferenceResolverBase<T extends ComponentBase<T>> {
        
     protected SynchronizationEventHandler eventHandler;
@@ -8,7 +8,6 @@ import java.util.Queue;
 
 import org.simantics.databoard.Bindings;
 import org.simantics.databoard.adapter.AdaptException;
-import org.simantics.db.exception.DatabaseException;
 import org.simantics.structural.synchronization.internal.Policy;
 import org.simantics.structural.synchronization.protocol.ChildInfo;
 import org.simantics.structural.synchronization.protocol.Connection;
@@ -379,7 +378,7 @@ public abstract class SynchronizationEventHandlerBase<T extends ComponentBase<T>
             ModuleUpdaterBase<T> updater;
             try {
                 updater = moduleUpdaterFactory.createUpdater(id);
-            } catch (DatabaseException e) {
+            } catch (Exception e) {
                 throw new RuntimeException(e);
             }
             if(updater == null)
@@ -1,4 +1,4 @@
-package org.simantics.structural.synchronization.base2;
+package org.simantics.structural.synchronization.protocol;
 
 import gnu.trove.map.hash.THashMap;
 import gnu.trove.set.hash.THashSet;
@@ -8,11 +8,6 @@ import java.util.Collection;
 import java.util.Map;
 
 import org.simantics.databoard.util.URIStringUtils;
-import org.simantics.structural.synchronization.protocol.ChildInfo;
-import org.simantics.structural.synchronization.protocol.Connection;
-import org.simantics.structural.synchronization.protocol.SerializedVariable;
-import org.simantics.structural.synchronization.protocol.SynchronizationEventHandler;
-import org.simantics.structural.synchronization.protocol.SynchronizationException;
 
 /**
  * <p>A partial implementation of SynchronizationEventHandler that contains all generic