package org.simantics.document.server.state;
import java.io.IOException;
-import java.util.Collections;
import java.util.Map;
-import java.util.Set;
import org.simantics.databoard.Bindings;
import org.simantics.databoard.binding.Binding;
import org.simantics.databoard.binding.mutable.Variant;
import org.simantics.databoard.serialization.RuntimeSerializerConstructionException;
import org.simantics.databoard.serialization.SerializerConstructionException;
-import org.simantics.db.layer0.variable.NodeSupport;
-import org.simantics.simulator.toolkit.StandardNodeManager;
import org.simantics.simulator.toolkit.StandardRealm;
+import org.simantics.simulator.toolkit.db.StandardVariableNodeManager;
import org.simantics.simulator.variable.exceptions.NodeManagerException;
import org.slf4j.LoggerFactory;
-public class StateNodeManager extends StandardNodeManager<StateNode, StateNodeManagerSupport> {
+public class StateNodeManager extends StandardVariableNodeManager<StateNode, StateNodeManagerSupport> {
private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(StateNodeManager.class);
- private NodeSupport<StateNode> support;
-
public StateNodeManager(StandardRealm<StateNode, StateNodeManagerSupport> realm, StateNode root) {
super(realm, root);
}
- public void registerSupport(NodeSupport<StateNode> support) {
- this.support = support;
- }
-
- @Override
- public Set<String> getClassifications(StateNode node) throws NodeManagerException {
- return Collections.emptySet();
- }
-
- @Override
- public void refreshVariable(StateNode node) {
- super.refreshVariable(node);
- support.valueCache.clearExpired();
- support.structureCache.clearExpired();
- }
-
public void setState(String key, Object value) {
try {
getRealm().syncExec(() -> {
import org.simantics.db.ReadGraph;
import org.simantics.db.exception.DatabaseException;
-import org.simantics.db.layer0.variable.NodeSupport;
-import org.simantics.simulator.toolkit.StandardNodeManager;
import org.simantics.simulator.toolkit.StandardRealm;
-import org.simantics.simulator.toolkit.db.StandardSessionManager;
+import org.simantics.simulator.toolkit.db.StandardVariableSessionManager;
-public class StateSessionManager extends StandardSessionManager<StateNode, StateNodeManagerSupport> {
+public class StateSessionManager extends StandardVariableSessionManager<StateNode, StateNodeManagerSupport> {
private static StateSessionManager INSTANCE;
return new StateRealm(engine, id);
}
- @Override
- public void registerNodeSupport(StandardNodeManager<StateNode, StateNodeManagerSupport> manager,
- NodeSupport<StateNode> support) {
- ((StateNodeManager)manager).registerSupport(support);
- }
-
}
import org.simantics.db.layer0.variable.NodeSupport;
import org.simantics.jdbc.SimanticsJDBC;
import org.simantics.simulator.toolkit.StandardRealm;
-import org.simantics.simulator.toolkit.db.StandardSessionManager;
+import org.simantics.simulator.toolkit.db.StandardVariableSessionManager;
import org.simantics.simulator.variable.exceptions.NodeManagerException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.impossibl.postgres.api.jdbc.PGNotificationListener;
import com.impossibl.postgres.jdbc.PGDataSource;
-public class JDBCSessionManager extends StandardSessionManager<JDBCNode, JDBCNodeManagerSupport> {
+public class JDBCSessionManager extends StandardVariableSessionManager<JDBCNode, JDBCNodeManagerSupport> {
private static final Logger LOGGER = LoggerFactory.getLogger(JDBCSessionManager.class);
private static JDBCSessionManager INSTANCE = new JDBCSessionManager();
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.simantics.simulator.toolkit;bundle-version="1.0.0";visibility:=reexport,
- org.simantics.db.layer0;bundle-version="1.1.0"
+ org.simantics.db.layer0;bundle-version="1.1.0",
+ org.slf4j.api;bundle-version="1.7.25"
Export-Package: org.simantics.simulator.toolkit.db
Bundle-Vendor: Semantum Oy
package org.simantics.simulator.toolkit.db;
-import java.util.Collection;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.simantics.db.ReadGraph;
-import org.simantics.db.WriteGraph;
-import org.simantics.db.common.request.ParametrizedPrimitiveRead;
-import org.simantics.db.exception.DatabaseException;
-import org.simantics.db.layer0.variable.NodeSupport;
-import org.simantics.db.procedure.Listener;
-import org.simantics.simulator.toolkit.StandardNodeManager;
import org.simantics.simulator.toolkit.StandardNodeManagerSupport;
-import org.simantics.simulator.toolkit.StandardRealm;
-
-public abstract class StandardSessionManager<Node, Engine extends StandardNodeManagerSupport<Node>> {
-
- private ConcurrentHashMap<String, Listener<StandardRealm<Node,Engine>>> realmListeners = new ConcurrentHashMap<>();
- private ConcurrentHashMap<String, StandardRealm<Node,Engine>> REALMS = new ConcurrentHashMap<>();
- private ConcurrentHashMap<String, NodeSupport<Node>> SUPPORTS = new ConcurrentHashMap<>();
-
- // Accessing Realms should be done over ParametrizedPrimitveRead for the
- // case if a realm is destroyed and new one is created with the same id than
- // the previously deleted one for the listeners to get discarded and new
- // registered
- private class RealmRequest extends ParametrizedPrimitiveRead<String, StandardRealm<Node, Engine>> {
-
- public RealmRequest(String parameter) {
- super(parameter);
- }
-
- @Override
- public void register(ReadGraph graph, Listener<StandardRealm<Node, Engine>> procedure) {
- StandardRealm<Node, Engine> realm = REALMS.get(parameter);
- if (realm == null) {
- try {
- realm = createRealmInner(graph, parameter);
- } catch (DatabaseException e) {
- e.printStackTrace();
- }
- }
-
- if(procedure.isDisposed()) {
- procedure.execute(realm);
- return;
- }
-
- Listener<StandardRealm<Node,Engine>> existing = getOrDisposeListener(parameter);
- assert(existing == null);
- realmListeners.put(parameter, procedure);
- procedure.execute(realm);
- }
-
- private StandardRealm<Node,Engine> createRealmInner(ReadGraph graph, String id) throws DatabaseException {
- Engine engine = createEngine(graph, id);
- StandardRealm<Node,Engine> realm = createRealm(engine, id);
- modifyRealms(id, realm);
- return realm;
- }
- }
-
- protected StandardSessionManager() {
- }
-
- private Listener<StandardRealm<Node,Engine>> getOrDisposeListener(String key) {
- Listener<StandardRealm<Node,Engine>> listener = realmListeners.get(key);
- if(listener != null) {
- if(listener.isDisposed()) {
- realmListeners.remove(key);
- } else {
- return listener;
- }
- }
- return null;
- }
-
- private void modifyRealms(String key, StandardRealm<Node,Engine> realm) {
- if(realm != null) {
- REALMS.put(key, realm);
- } else {
- StandardRealm<Node, Engine> removedRealm = REALMS.remove(key);
- if (removedRealm != null)
- removedRealm.close();
- }
- Listener<StandardRealm<Node,Engine>> listener = getOrDisposeListener(key);
- if(listener != null) {
- listener.execute(realm);
- }
- }
-
- public void registerNodeSupport(StandardNodeManager<Node,Engine> realm, NodeSupport<Node> support) {
-
- }
-
- public NodeSupport<Node> getOrCreateNodeSupport(ReadGraph graph, String id) throws DatabaseException {
- synchronized(SUPPORTS) {
- NodeSupport<Node> result = SUPPORTS.get(id);
- if(result == null) {
- StandardRealm<Node,Engine> realm = getOrCreateRealm(graph, id);
- result = new NodeSupport<Node>(realm.getNodeManager());
- registerNodeSupport(realm.getNodeManager(), result);
- SUPPORTS.put(id, result);
- }
- return result;
- }
- }
-
- public StandardRealm<Node,Engine> getOrCreateRealm(ReadGraph graph, String id) throws DatabaseException {
- synchronized(REALMS) {
- return graph.syncRequest(new RealmRequest(id));
- }
- }
-
- protected abstract Engine createEngine(ReadGraph graph, String id) throws DatabaseException;
- protected abstract StandardRealm<Node,Engine> createRealm(Engine engine, String id);
- public void removeRealm(WriteGraph graph, String id) throws DatabaseException {
- modifyRealms(id, null);
- // remove listeners from this realm
- realmListeners.remove(id);
- // if node support has been created remove it as well
- NodeSupport<Node> support = SUPPORTS.remove(id);
- if (support != null)
- support.dispose();
- }
+public abstract class StandardSessionManager<Node, Engine extends StandardNodeManagerSupport<Node>> extends StandardVariableSessionManager<Node,Engine> {
- public Collection<String> getRealms() {
- return REALMS.keySet();
- }
}
--- /dev/null
+package org.simantics.simulator.toolkit.db;
+
+import org.simantics.db.ReadGraph;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.db.layer0.variable.NodeManagerVariableBuilder;
+import org.simantics.db.layer0.variable.NodeSupport;
+import org.simantics.simulator.toolkit.StandardNodeManager;
+
+abstract public class StandardVariableManagerVariableBuilder extends NodeManagerVariableBuilder {
+
+ @Override
+ protected Object getRoot(ReadGraph graph, NodeSupport<?> support, String sessionName) {
+ StandardNodeManager manager = (StandardNodeManager)support.manager;
+ return manager.getRoot();
+ }
+
+ /*
+ * For compatibility reasons. Existing implementations implement getNodeSupport directly and in that case this is not needed.
+ * New implementations should not implement getNodeSupport but rather implement this.
+ */
+ protected StandardVariableSessionManager getSessionManager() {
+ throw new UnsupportedOperationException();
+ }
+
+ protected NodeSupport<?> getNodeSupport(ReadGraph graph, String sessionName) throws DatabaseException {
+ return getSessionManager().getOrCreateNodeSupport(graph, sessionName);
+ }
+
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2013 Association for Decentralized Information Management
+ * in Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VTT Technical Research Centre of Finland - initial API and implementation
+ * Semantum Oy - initial API and implementation
+ *******************************************************************************/
+package org.simantics.simulator.toolkit.db;
+
+import org.simantics.db.layer0.variable.NodeSupport;
+import org.simantics.simulator.toolkit.StandardNodeManager;
+import org.simantics.simulator.toolkit.StandardNodeManagerSupport;
+import org.simantics.simulator.toolkit.StandardRealm;
+
+/**
+ * Adds support for Layer0 Variable interface in StandardNodeManager
+ *
+ * @author Antti Villberg
+ */
+public class StandardVariableNodeManager<Node, Engine extends StandardNodeManagerSupport<Node>> extends StandardNodeManager<Node,Engine> {
+
+ protected NodeSupport<Node> support;
+
+ public StandardVariableNodeManager(StandardRealm<Node, Engine> realm, Node root) {
+ super(realm, root);
+ this.support = new NodeSupport<>(this);
+ }
+
+/* public void registerNodeSupport(NodeSupport<Node> support) {
+ this.support = support;
+ }
+
+
+ public void registerSupport(NodeSupport<Node> support) {
+ this.support = support;
+ }*/
+
+ @Override
+ public void refreshVariable(Node node) {
+ super.refreshVariable(node);
+ support.valueCache.clearExpired();
+ support.structureCache.clearExpired();
+ }
+
+}
\ No newline at end of file
--- /dev/null
+package org.simantics.simulator.toolkit.db;
+
+import org.simantics.simulator.toolkit.StandardNodeManager;
+import org.simantics.simulator.toolkit.StandardNodeManagerSupport;
+import org.simantics.simulator.toolkit.StandardRealm;
+
+abstract public class StandardVariableRealm<Node, Engine extends StandardNodeManagerSupport<Node>> extends StandardRealm<Node, Engine> {
+
+ protected StandardVariableRealm(Engine engine, String id) {
+ super(engine, id);
+ }
+
+ @Override
+ protected StandardNodeManager<Node, Engine> createManager(Node root) {
+ return new StandardVariableNodeManager<Node, Engine>(this, root);
+ }
+
+}
\ No newline at end of file
--- /dev/null
+package org.simantics.simulator.toolkit.db;
+
+import java.util.Collection;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.simantics.db.ReadGraph;
+import org.simantics.db.WriteGraph;
+import org.simantics.db.common.request.ParametrizedPrimitiveRead;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.db.layer0.variable.NodeSupport;
+import org.simantics.db.procedure.Listener;
+import org.simantics.simulator.toolkit.StandardNodeManagerSupport;
+import org.simantics.simulator.toolkit.StandardRealm;
+import org.simantics.simulator.variable.NodeManager;
+
+public abstract class StandardVariableSessionManager<Node, Engine extends StandardNodeManagerSupport<Node>> {
+
+ private ConcurrentHashMap<String, Listener<StandardRealm<Node,Engine>>> realmListeners = new ConcurrentHashMap<>();
+ private ConcurrentHashMap<String, StandardRealm<Node,Engine>> REALMS = new ConcurrentHashMap<>();
+ private ConcurrentHashMap<String, NodeSupport<Node>> SUPPORTS = new ConcurrentHashMap<>();
+
+ // Accessing Realms should be done over ParametrizedPrimitveRead for the
+ // case if a realm is destroyed and new one is created with the same id than
+ // the previously deleted one for the listeners to get discarded and new
+ // registered
+ private class RealmRequest extends ParametrizedPrimitiveRead<String, StandardRealm<Node, Engine>> {
+
+ public RealmRequest(String parameter) {
+ super(parameter);
+ }
+
+ @Override
+ public void register(ReadGraph graph, Listener<StandardRealm<Node, Engine>> procedure) {
+ StandardRealm<Node, Engine> realm = REALMS.get(parameter);
+ if (realm == null) {
+ try {
+ realm = createRealmInner(graph, parameter);
+ } catch (DatabaseException e) {
+ e.printStackTrace();
+ }
+ }
+
+ if(procedure.isDisposed()) {
+ procedure.execute(realm);
+ return;
+ }
+
+ Listener<StandardRealm<Node,Engine>> existing = getOrDisposeListener(parameter);
+ assert(existing == null);
+ realmListeners.put(parameter, procedure);
+ procedure.execute(realm);
+ }
+
+ private StandardRealm<Node,Engine> createRealmInner(ReadGraph graph, String id) throws DatabaseException {
+ Engine engine = createEngine(graph, id);
+ StandardRealm<Node,Engine> realm = createRealm(engine, id);
+ modifyRealms(id, realm);
+ return realm;
+ }
+ }
+
+ protected StandardVariableSessionManager() {
+ }
+
+ private Listener<StandardRealm<Node,Engine>> getOrDisposeListener(String key) {
+ Listener<StandardRealm<Node,Engine>> listener = realmListeners.get(key);
+ if(listener != null) {
+ if(listener.isDisposed()) {
+ realmListeners.remove(key);
+ } else {
+ return listener;
+ }
+ }
+ return null;
+ }
+
+ private void modifyRealms(String key, StandardRealm<Node,Engine> realm) {
+ if(realm != null) {
+ REALMS.put(key, realm);
+ } else {
+ StandardRealm<Node, Engine> removedRealm = REALMS.remove(key);
+ if (removedRealm != null)
+ removedRealm.close();
+ }
+ Listener<StandardRealm<Node,Engine>> listener = getOrDisposeListener(key);
+ if(listener != null) {
+ listener.execute(realm);
+ }
+ }
+
+ public NodeSupport<Node> getOrCreateNodeSupport(ReadGraph graph, String id) throws DatabaseException {
+ synchronized(SUPPORTS) {
+ NodeSupport<Node> result = SUPPORTS.get(id);
+ if(result == null) {
+ StandardRealm<Node,Engine> realm = getOrCreateRealm(graph, id);
+ NodeManager nodeManager = realm.getNodeManager();
+ if(!(nodeManager instanceof StandardVariableNodeManager))
+ throw new DatabaseException("StandardVariableSessionManager requires an instance of StandardVariableNodeManager, got " + nodeManager.getClass());
+ StandardVariableNodeManager svnm = (StandardVariableNodeManager)nodeManager;
+ result = svnm.support;
+ SUPPORTS.put(id, result);
+ }
+ return result;
+ }
+ }
+
+ public StandardRealm<Node,Engine> getOrCreateRealm(ReadGraph graph, String id) throws DatabaseException {
+ synchronized(REALMS) {
+ return graph.syncRequest(new RealmRequest(id));
+ }
+ }
+
+ protected abstract Engine createEngine(ReadGraph graph, String id) throws DatabaseException;
+ protected abstract StandardRealm<Node,Engine> createRealm(Engine engine, String id);
+
+ public void removeRealm(WriteGraph graph, String id) throws DatabaseException {
+ modifyRealms(id, null);
+ // remove listeners from this realm
+ realmListeners.remove(id);
+ // if node support has been created remove it as well
+ NodeSupport<Node> support = SUPPORTS.remove(id);
+ if (support != null)
+ support.dispose();
+ }
+
+ public Collection<String> getRealms() {
+ return REALMS.keySet();
+ }
+}
package org.simantics.simulator.toolkit;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
*
* @author Antti Villberg
*/
-public abstract class StandardNodeManager<Node, Engine extends StandardNodeManagerSupport<Node>> implements NodeManager<Node> {
+public class StandardNodeManager<Node, Engine extends StandardNodeManagerSupport<Node>> implements NodeManager<Node> {
private static final Logger LOGGER = LoggerFactory.getLogger(StandardNodeManager.class);
valueCache.clear();
listeners.clear();
}
-
+
+ @Override
+ public Set<String> getClassifications(Node node) throws NodeManagerException {
+ return Collections.emptySet();
+ }
+
}
\ No newline at end of file
this.nodeManager = createManager();
}
- abstract protected StandardNodeManager<Node, Engine> createManager();
+ protected StandardNodeManager<Node, Engine> createManager(Node root) {
+ return new StandardNodeManager<Node, Engine>(this, root);
+ }
+
+ protected StandardNodeManager<Node, Engine> createManager() {
+ return createManager(createRootNode());
+ }
+
+ /*
+ * For compatibility reasons. Existing implementations implement createManager() directly and in that case this is not needed.
+ * New implementations should not implement createManager() but rather implement this.
+ */
+ protected Node createRootNode() {
+ throw new UnsupportedOperationException();
+ }
protected String getSCLContextKey() {
return getClass().getSimpleName();
import org.simantics.spreadsheet.graph.synchronization.NullUpdater;
import org.simantics.spreadsheet.graph.synchronization.SheetLineComponent;
import org.simantics.spreadsheet.graph.synchronization.StyleUpdater;
-import org.simantics.structural.synchronization.base.ComponentFactory;
-import org.simantics.structural.synchronization.base.MappingBase;
import org.simantics.structural.synchronization.base.ModuleUpdaterBase;
import org.simantics.structural.synchronization.base.ModuleUpdaterFactoryBase;
-import org.simantics.structural.synchronization.base.Solver;
import org.simantics.structural.synchronization.base.SolverNameUtil;
+import org.simantics.structural.synchronization.utils.ComponentFactory;
+import org.simantics.structural.synchronization.utils.MappingBase;
+import org.simantics.structural.synchronization.utils.Solver;
import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap;
import it.unimi.dsi.fastutil.longs.AbstractLongList;
import java.io.Serializable;
import org.simantics.spreadsheet.graph.synchronization.SheetLineComponent;
-import org.simantics.structural.synchronization.base.ComponentFactory;
-import org.simantics.structural.synchronization.base.MappingBase;
-import org.simantics.structural.synchronization.base.Solver;
-import org.simantics.structural.synchronization.base.StateUndoContextBase;
+import org.simantics.structural.synchronization.utils.ComponentFactory;
+import org.simantics.structural.synchronization.utils.MappingBase;
+import org.simantics.structural.synchronization.utils.Solver;
+import org.simantics.structural.synchronization.utils.StateUndoContextBase;
public class SpreadsheetMapping extends MappingBase<SheetLineComponent> implements Serializable {
import org.simantics.spreadsheet.graph.synchronization.SheetLineComponent;
import org.simantics.structural.synchronization.base.ReferenceResolverBase;
-import org.simantics.structural.synchronization.base.Solver;
+import org.simantics.structural.synchronization.utils.Solver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.simantics.db.layer0.variable.Variable;
import org.simantics.db.layer0.variable.Variables;
import org.simantics.simulator.toolkit.StandardRealm;
-import org.simantics.simulator.toolkit.db.StandardSessionManager;
+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.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class SpreadsheetSessionManager extends StandardSessionManager<SheetNode, SpreadsheetBook> {
+public class SpreadsheetSessionManager extends StandardVariableSessionManager<SheetNode, SpreadsheetBook> {
private static final Logger LOGGER = LoggerFactory.getLogger(SpreadsheetSessionManager.class);
import org.simantics.spreadsheet.graph.parser.ast.AstArrayFormulaReference;
import org.simantics.spreadsheet.graph.parser.ast.AstValue;
import org.simantics.structural.synchronization.base.CommandBuilder;
-import org.simantics.structural.synchronization.base.Solver;
+import org.simantics.structural.synchronization.utils.Solver;
public class LineCommandBuilder implements 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.base.Solver;
+import org.simantics.structural.synchronization.utils.Solver;
public class LineUpdater extends ModuleUpdaterBase<SheetLineComponent> {
import org.simantics.spreadsheet.graph.SpreadsheetBook;
import org.simantics.spreadsheet.graph.SpreadsheetLines;
import org.simantics.structural.synchronization.base.CommandBuilder;
-import org.simantics.structural.synchronization.base.Solver;
+import org.simantics.structural.synchronization.utils.Solver;
public class LinesCommandBuilder implements CommandBuilder {
package org.simantics.spreadsheet.graph.synchronization;
import org.simantics.structural.synchronization.base.CommandBuilder;
-import org.simantics.structural.synchronization.base.Solver;
+import org.simantics.structural.synchronization.utils.Solver;
public class NullCommandBuilder implements CommandBuilder {
import java.io.Serializable;
-import org.simantics.structural.synchronization.base.ComponentBase;
+import org.simantics.structural.synchronization.utils.ComponentBase;
import gnu.trove.map.hash.THashMap;
import gnu.trove.procedure.TObjectProcedure;
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.base.Solver;
+import org.simantics.structural.synchronization.utils.Solver;
public class StyleUpdater extends ModuleUpdaterBase<SheetLineComponent> {
package org.simantics.structural.synchronization.base;
+import org.simantics.structural.synchronization.utils.Solver;
+
public interface CommandBuilder {
void apply(Solver solver);
import java.util.Map;
import org.simantics.databoard.binding.mutable.Variant;
+import org.simantics.structural.synchronization.utils.ComponentBase;
public interface ConnectionUpdateRule<T extends ComponentBase<T>> {
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;
public class ModuleUpdateContext<T extends ComponentBase<T>> {
import org.simantics.databoard.binding.mutable.Variant;
import org.simantics.structural.synchronization.protocol.Connection;
import org.simantics.structural.synchronization.protocol.SerializedVariable;
+import org.simantics.structural.synchronization.utils.ComponentBase;
abstract public class ModuleUpdaterBase<T extends ComponentBase<T>> {
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>> {
import java.util.Map;
import org.simantics.databoard.binding.mutable.Variant;
+import org.simantics.structural.synchronization.utils.ComponentBase;
public interface PropertyUpdateRule<T extends ComponentBase<T>> {
import org.simantics.databoard.util.URIStringUtils;
import org.simantics.structural.synchronization.protocol.SynchronizationEventHandler;
+import org.simantics.structural.synchronization.utils.ComponentBase;
+import org.simantics.structural.synchronization.utils.Solver;
import org.slf4j.Logger;
abstract public class ReferenceResolverBase<T extends ComponentBase<T>> {
private static void fullPathOfComponent(StringBuilder b, ComponentBase<?> component) {
if(component != null) {
- fullPathOfComponent(b, component.parent);
+ fullPathOfComponent(b, component.getParent());
b.append("/").append(component.solverComponentName);
}
}
import org.simantics.structural.synchronization.protocol.SerializedVariable;
import org.simantics.structural.synchronization.protocol.SynchronizationEventHandler;
import org.simantics.structural.synchronization.protocol.SynchronizationException;
+import org.simantics.structural.synchronization.utils.ComponentBase;
+import org.simantics.structural.synchronization.utils.ComponentFactory;
+import org.simantics.structural.synchronization.utils.MappingBase;
+import org.simantics.structural.synchronization.utils.Solver;
import org.slf4j.Logger;
import gnu.trove.map.hash.THashMap;
import org.simantics.db.exception.CancelTransactionException;
import org.simantics.db.exception.DatabaseException;
import org.simantics.db.layer0.variable.Variable;
+import org.simantics.structural.synchronization.utils.ComponentBase;
import gnu.trove.map.hash.THashMap;
-package org.simantics.structural.synchronization.base;
+package org.simantics.structural.synchronization.utils;
import gnu.trove.map.hash.THashMap;
import gnu.trove.procedure.TObjectObjectProcedure;
-package org.simantics.structural.synchronization.base;
+package org.simantics.structural.synchronization.utils;
public interface ComponentFactory<T extends ComponentBase<T>> {
-package org.simantics.structural.synchronization.base;
+package org.simantics.structural.synchronization.utils;
+
+import java.io.PrintWriter;
import gnu.trove.map.hash.THashMap;
import gnu.trove.procedure.TObjectObjectProcedure;
import gnu.trove.procedure.TObjectProcedure;
import gnu.trove.set.hash.THashSet;
-import java.io.PrintWriter;
-
/**
* The entry point to the mapping structure between Simantics database and a
* designated solver. It is used to synchronize changes from Simantics to the
-package org.simantics.structural.synchronization.base;
+package org.simantics.structural.synchronization.utils;
public interface Solver {
-package org.simantics.structural.synchronization.base;
-
+package org.simantics.structural.synchronization.utils;
/**
* Stores state information of removed modules.