]> gerrit.simantics Code Review - simantics/r.git/commitdiff
Fixed org.simantics.r trunk to compile after the changes done in #6287.
authorlehtonen <lehtonen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 22 Apr 2016 12:27:28 +0000 (12:27 +0000)
committerlehtonen <lehtonen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 22 Apr 2016 12:27:28 +0000 (12:27 +0000)
refs #6287

git-svn-id: https://www.simantics.org/svn/simantics/r/trunk@32696 ac1ea38d-2e2b-0410-8846-a27921b304fc

13 files changed:
org.simantics.r.ontology/.classpath
org.simantics.r.ontology/.settings/org.eclipse.jdt.core.prefs
org.simantics.r.ontology/META-INF/MANIFEST.MF
org.simantics.r.scl/.classpath
org.simantics.r.scl/.settings/org.eclipse.jdt.core.prefs
org.simantics.r.scl/META-INF/MANIFEST.MF
org.simantics.r.scl/scl/R/R.scl
org.simantics.r.scl/src/org/simantics/r/scl/RSession.java
org.simantics.r.scl/src/org/simantics/r/scl/RSessionManager.java
org.simantics.r/.classpath
org.simantics.r/.settings/org.eclipse.jdt.core.prefs
org.simantics.r/META-INF/MANIFEST.MF
org.simantics.r/src/org/simantics/r/RVariableBuilder.java

index b1dabee38291b97f08cc3a18bee4e65b1e550530..b862a296d38fe04269faeee6c9d77d11ff77380d 100644 (file)
@@ -1,6 +1,6 @@
 <?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
index 11f6e462df7b697da0744bef232871f1aa1b0cb3..295926d964165896ea8aa7c1b1b3c9d3d3caa77e 100644 (file)
@@ -1,7 +1,7 @@
 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
index 2b5576d1942b9db85afbcc8be5418a93a3c4f679..9db08a6ac9a1762d0ffb913572b9b0d13596d4f3 100644 (file)
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
 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",
index b1dabee38291b97f08cc3a18bee4e65b1e550530..b862a296d38fe04269faeee6c9d77d11ff77380d 100644 (file)
@@ -1,6 +1,6 @@
 <?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
index 467b8c4ead663a0cfba72af7c553a95cd3a9d0b7..62b7e4d656958c71040627c53133cf5ebf041613 100644 (file)
@@ -6,8 +6,8 @@ org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annota
 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
@@ -92,4 +92,4 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
 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
index e4837354b0a9a8fa84bd2d73b5f539c9e528a6d8..5676aa6906ae5d30bf56892b806998378a102ca5 100644 (file)
@@ -3,12 +3,13 @@ Bundle-ManifestVersion: 2
 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,
index ef82084007b8a0a9fbecbf96063cffd5769f3752..28b2bacf6c502034e75afe0f92dfc42e7e670ecd 100644 (file)
@@ -53,7 +53,7 @@ readFileAsStringR :: String -> <R> String
 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
index 62812a29090d7427468730bf9f0ee4b436fb24fd..120ce058cd6f1969642ed0b487885c0f6411ec5f 100644 (file)
@@ -20,7 +20,6 @@ import java.util.concurrent.TimeUnit;
 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
@@ -148,7 +147,7 @@ public class RSession implements Realm {
         connection.close();\r
     }\r
 \r
-    public NodeManager<RVariableNode> getNodeManager() {\r
+    public NodeManager getNodeManager() {\r
         return nodeManager;\r
     }\r
 }\r
index 8f1a92dc20c2fb8cb12f4269e02a2c4a58fcc9b7..86c6f9676f36714af117893480045d5aa9948d5c 100644 (file)
@@ -16,11 +16,15 @@ import java.util.concurrent.ConcurrentHashMap;
 \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
@@ -65,4 +69,16 @@ public class RSessionManager {
             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
index b1dabee38291b97f08cc3a18bee4e65b1e550530..b862a296d38fe04269faeee6c9d77d11ff77380d 100644 (file)
@@ -1,6 +1,6 @@
 <?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
index 11f6e462df7b697da0744bef232871f1aa1b0cb3..295926d964165896ea8aa7c1b1b3c9d3d3caa77e 100644 (file)
@@ -1,7 +1,7 @@
 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
index 7b9ea8881ff09779448e8bc04f622a72352b482a..4a8a87e368d26a73bdb48fa136b9204e38445e64 100644 (file)
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
 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",
index 90261a34d2f0045f298875c14b6ec66930013b9c..6c0366f22fb5bf2c303426e02df978fedf10768d 100644 (file)
@@ -8,6 +8,7 @@
  *\r
  * Contributors:\r
  *     VTT Technical Research Centre of Finland - initial API and implementation\r
+ *     Semantum Oy\r
  *******************************************************************************/\r
 package org.simantics.r;\r
 \r
@@ -16,9 +17,10 @@ import org.simantics.databoard.Bindings;
 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
@@ -27,7 +29,7 @@ import org.simantics.r.scl.RSessionManager;
 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
@@ -49,13 +51,19 @@ public class RVariableBuilder implements VariableBuilder {
             }\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