From: Tuukka Lehtonen Date: Wed, 10 Jun 2020 18:16:51 +0000 (+0300) Subject: Start of AdapterRegistry2 internal query caching. X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=67c59e5e66ba411e770545a6137b13fe3de60aab;p=simantics%2Fplatform.git Start of AdapterRegistry2 internal query caching. Doesn't do anything yet, more for safekeeping. gitlab #555 Change-Id: I9d72ee72ac6ecf32353f367b235461e79fa70d14 --- diff --git a/bundles/org.simantics.db.services/src/org/simantics/db/services/adaption/AdapterRegistry2.java b/bundles/org.simantics.db.services/src/org/simantics/db/services/adaption/AdapterRegistry2.java index 0e52b8a41..478d3ebee 100644 --- a/bundles/org.simantics.db.services/src/org/simantics/db/services/adaption/AdapterRegistry2.java +++ b/bundles/org.simantics.db.services/src/org/simantics/db/services/adaption/AdapterRegistry2.java @@ -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(); diff --git a/bundles/org.simantics.db.services/src/org/simantics/db/services/adaption/reflection/GraphObject2.java b/bundles/org.simantics.db.services/src/org/simantics/db/services/adaption/reflection/GraphObject2.java index e8f171b8c..8a2db578f 100644 --- a/bundles/org.simantics.db.services/src/org/simantics/db/services/adaption/reflection/GraphObject2.java +++ b/bundles/org.simantics.db.services/src/org/simantics/db/services/adaption/reflection/GraphObject2.java @@ -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; diff --git a/bundles/org.simantics.db.services/src/org/simantics/db/services/adaption/reflection/ThisResource2.java b/bundles/org.simantics.db.services/src/org/simantics/db/services/adaption/reflection/ThisResource2.java index 24001ee0a..bacf3adee 100644 --- a/bundles/org.simantics.db.services/src/org/simantics/db/services/adaption/reflection/ThisResource2.java +++ b/bundles/org.simantics.db.services/src/org/simantics/db/services/adaption/reflection/ThisResource2.java @@ -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;