]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Start of AdapterRegistry2 internal query caching.
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Wed, 10 Jun 2020 18:16:51 +0000 (21:16 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Wed, 17 Jun 2020 20:53:40 +0000 (23:53 +0300)
Doesn't do anything yet, more for safekeeping.

gitlab #555

Change-Id: I9d72ee72ac6ecf32353f367b235461e79fa70d14
(cherry picked from commit 67c59e5e66ba411e770545a6137b13fe3de60aab)

bundles/org.simantics.db.services/src/org/simantics/db/services/adaption/AdapterRegistry2.java
bundles/org.simantics.db.services/src/org/simantics/db/services/adaption/reflection/GraphObject2.java
bundles/org.simantics.db.services/src/org/simantics/db/services/adaption/reflection/ThisResource2.java

index 0db80b1b4f5cb48044709875cf3b821aabca4278..e9b59023fbb28130c45a14782805e3cdb4b864af 100644 (file)
@@ -237,9 +237,9 @@ public class AdapterRegistry2 {
                 NamedNodeMap attr = n.getAttributes();
                 IDynamicAdapter2 da = null;
                 if(n.getNodeName().equals("this"))
-                    da = new ThisResource2();
+                    da = ThisResource2.INSTANCE;
                 else if(n.getNodeName().equals("graph"))
-                    da = new GraphObject2();
+                    da = GraphObject2.INSTANCE;
                 else if(n.getNodeName().equals("bundle")) {
                     String bundleId = null;
                     Node fc = n.getFirstChild();
index e8f171b8ca02a170268d4270e442ed3655ffad9d..8a2db578f6488debda2a66fa3d1719c6772cca10 100644 (file)
@@ -15,6 +15,8 @@ import org.simantics.db.ReadGraph;
 
 public class GraphObject2 implements IDynamicAdapter2 {
 
+       public static final IDynamicAdapter2 INSTANCE = new GraphObject2();
+
        @Override
        public Class<?> getType() {
                return ReadGraph.class;
index 24001ee0ae90840a5333a3c2665a098b92f42f23..bacf3adee83f92185c46572121f751e0a8e67de7 100644 (file)
@@ -16,6 +16,8 @@ import org.simantics.db.ReadGraph;
 
 public class ThisResource2 implements IDynamicAdapter2 {
 
+       public static IDynamicAdapter2 INSTANCE = new ThisResource2();
+
        @Override
        public Class<?> getType() {
                return Resource.class;