<?xml version="1.0" encoding="UTF-8"?>\r
<classpath>\r
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>\r
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>\r
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
<classpathentry kind="src" path="src"/>\r
<classpathentry kind="output" path="bin"/>\r
eclipse.preferences.version=1\r
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled\r
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7\r
-org.eclipse.jdt.core.compiler.compliance=1.7\r
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8\r
+org.eclipse.jdt.core.compiler.compliance=1.8\r
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error\r
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error\r
-org.eclipse.jdt.core.compiler.source=1.7\r
+org.eclipse.jdt.core.compiler.source=1.8\r
Bundle-Name: http://www.simantics.org/R
Bundle-SymbolicName: org.simantics.r.ontology
Bundle-Version: 1.0.0.qualifier
-Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.simantics.layer0;bundle-version="1.1.0",
org.simantics.simulation.ontology;bundle-version="1.1.0",
org.simantics.selectionview.ontology;bundle-version="1.2.0",
<?xml version="1.0" encoding="UTF-8"?>\r
<classpath>\r
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>\r
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>\r
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
<classpathentry kind="src" path="src"/>\r
<classpathentry kind="output" path="bin"/>\r
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable\r
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled\r
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled\r
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7\r
-org.eclipse.jdt.core.compiler.compliance=1.7\r
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8\r
+org.eclipse.jdt.core.compiler.compliance=1.8\r
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning\r
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error\r
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore\r
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore\r
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning\r
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning\r
-org.eclipse.jdt.core.compiler.source=1.7\r
+org.eclipse.jdt.core.compiler.source=1.8\r
Bundle-Name: RServe connectivity
Bundle-SymbolicName: org.simantics.r.scl;singleton:=true
Bundle-Version: 0.1.0.qualifier
-Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.simantics.scl.runtime;bundle-version="0.4.0",
gnu.trove3;bundle-version="3.0.3",
org.simantics.simulator.variable;bundle-version="1.0.0",
org.simantics.structural.ontology,
- org.simantics.utils.datastructures;bundle-version="1.1.0"
+ org.simantics.utils.datastructures;bundle-version="1.1.0",
+ org.simantics.db.layer0
Export-Package: org.rosuda.REngine,
org.rosuda.REngine.Rserve,
org.rosuda.REngine.Rserve.protocol,
readFileAsStringR name = runProc (readAllString (openFileR name))\r
\r
test () = do\r
- conf = SessionConfiguration "130.188.198.138" 6311 "simupedia" "simupedia"\r
+ conf = SessionConfiguration "localhost" 6311 "simupedia" "simupedia"\r
session = createSession conf\r
print $ syncExec session (evalR "1+1")\r
closeSession session
\ No newline at end of file
import org.rosuda.REngine.Rserve.RConnection;\r
import org.rosuda.REngine.Rserve.RserveException;\r
import org.simantics.r.scl.variable.RNodeManager;\r
-import org.simantics.r.scl.variable.RVariableNode;\r
import org.simantics.scl.runtime.SCLContext;\r
import org.simantics.scl.runtime.function.Function;\r
import org.simantics.scl.runtime.tuple.Tuple0;\r
connection.close();\r
}\r
\r
- public NodeManager<RVariableNode> getNodeManager() {\r
+ public NodeManager getNodeManager() {\r
return nodeManager;\r
}\r
}\r
\r
import org.rosuda.REngine.Rserve.RConnection;\r
import org.rosuda.REngine.Rserve.RserveException;\r
+import org.simantics.db.layer0.variable.NodeSupport;\r
import org.simantics.scl.runtime.function.Function;\r
\r
public class RSessionManager {\r
static ConcurrentHashMap<String, RSession> CONNECTIONS =\r
new ConcurrentHashMap<String, RSession>(); \r
+\r
+ static ConcurrentHashMap<String, NodeSupport<String>> SUPPORTS =\r
+ new ConcurrentHashMap<String, NodeSupport<String>>(); \r
\r
public static RSession getSession(String id) {\r
// CONNECTIONS is ConcurrentHashMap so no synchronization is needed here\r
return managedConnection;\r
}\r
}\r
+ \r
+ public static NodeSupport<String> getOrCreateNodeSupport(String id) {\r
+ synchronized(SUPPORTS) {\r
+ NodeSupport<String> result = SUPPORTS.get(id);\r
+ if(result == null) {\r
+ RSession session = getSession(id);\r
+ result = new NodeSupport<String>(session.getNodeManager());\r
+ SUPPORTS.put(id, result);\r
+ }\r
+ return result;\r
+ }\r
+ }\r
}\r
<?xml version="1.0" encoding="UTF-8"?>\r
<classpath>\r
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>\r
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>\r
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
<classpathentry kind="src" path="src"/>\r
<classpathentry kind="output" path="bin"/>\r
eclipse.preferences.version=1\r
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled\r
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7\r
-org.eclipse.jdt.core.compiler.compliance=1.7\r
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8\r
+org.eclipse.jdt.core.compiler.compliance=1.8\r
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error\r
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error\r
-org.eclipse.jdt.core.compiler.source=1.7\r
+org.eclipse.jdt.core.compiler.source=1.8\r
Bundle-Name: R Variable for Simantics
Bundle-SymbolicName: org.simantics.r;singleton:=true
Bundle-Version: 0.1.0.qualifier
-Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.simantics.r.ontology;bundle-version="1.0.0",
org.simantics.r.scl;bundle-version="0.0.1",
org.simantics.scl.runtime;bundle-version="0.4.0",
*\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
+ * Semantum Oy\r
*******************************************************************************/\r
package org.simantics.r;\r
\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.variable.NodeManagerVariableBuilder;\r
+import org.simantics.db.layer0.variable.NodeSupport;\r
import org.simantics.db.layer0.variable.StandardGraphChildVariable;\r
import org.simantics.db.layer0.variable.Variable;\r
-import org.simantics.db.layer0.variable.VariableBuilder;\r
import org.simantics.db.layer0.variable.VariableNode;\r
import org.simantics.layer0.Layer0;\r
import org.simantics.r.scl.RSession;\r
import org.simantics.r.scl.variable.RVariableNode;\r
import org.simantics.simulator.variable.NodeManager;\r
\r
-public class RVariableBuilder implements VariableBuilder {\r
+public class RVariableBuilder extends NodeManagerVariableBuilder {\r
\r
@Override\r
public Variable buildChild(ReadGraph graph, Variable parent, VariableNode node, Resource child) throws DatabaseException {\r
}\r
}\r
\r
+ NodeSupport<?> support = getNodeSupport(graph, name);\r
NodeManager<RVariableNode> nodeManager = session.getNodeManager();\r
- return new StandardGraphChildVariable(parent, new VariableNode(nodeManager, /*node=*/nodeManager), child);\r
+ return new StandardGraphChildVariable(parent, new VariableNode(support, nodeManager), child);\r
}\r
\r
@Override\r
- public Variable buildProperty(ReadGraph graph, Variable parent, VariableNode node, Resource subject, Resource predicate) throws DatabaseException {\r
- throw new UnsupportedOperationException();\r
+ protected NodeSupport<?> getNodeSupport(ReadGraph graph, String sessionName) throws DatabaseException {\r
+ return RSessionManager.getOrCreateNodeSupport(sessionName);\r
+ }\r
+\r
+ @Override\r
+ protected Object getRoot(ReadGraph graph, NodeSupport<?> support, String sessionName) throws DatabaseException {\r
+ return support.manager;\r
}\r
\r
}\r