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

gitlab #555

Change-Id: I9d72ee72ac6ecf32353f367b235461e79fa70d14

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 0e52b8a417da4ebecf82c27369cf7581171c58e4..478d3ebee93b22dcf2cacd18326dc407ff5595ca 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;