From: Tuukka Lehtonen Date: Mon, 3 Aug 2020 11:13:44 +0000 (+0300) Subject: Inherit HandleEventRequest from UnaryRequest to support request caching X-Git-Tag: v1.43.0~4 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F61%2F4361%2F1;p=simantics%2Fplatform.git Inherit HandleEventRequest from UnaryRequest to support request caching gitlab #577 Change-Id: I352fff5f444c74006deb774eee8ddd762d90385c (cherry picked from commit d96e94b9ad3de7da56fda39883aa8f0c84e38a50) --- diff --git a/bundles/org.simantics.document.server/src/org/simantics/document/server/request/HandleEventRequest.java b/bundles/org.simantics.document.server/src/org/simantics/document/server/request/HandleEventRequest.java index 606b361b6..4c611a9aa 100644 --- a/bundles/org.simantics.document.server/src/org/simantics/document/server/request/HandleEventRequest.java +++ b/bundles/org.simantics.document.server/src/org/simantics/document/server/request/HandleEventRequest.java @@ -1,19 +1,17 @@ package org.simantics.document.server.request; import org.simantics.db.ReadGraph; +import org.simantics.db.common.request.UnaryRead; import org.simantics.db.exception.DatabaseException; import org.simantics.db.layer0.variable.Variable; import org.simantics.db.layer0.variable.Variables; -import org.simantics.db.request.Read; import org.simantics.document.server.handler.AbstractEventHandler; import org.simantics.structural.stubs.StructuralResource2; -public class HandleEventRequest implements Read { - - final String id; +public class HandleEventRequest extends UnaryRead { public HandleEventRequest(String id) { - this.id = id; + super(id); } @Override @@ -21,7 +19,7 @@ public class HandleEventRequest implements Read { StructuralResource2.getInstance(graph); - Variable variable = Variables.getPossibleVariable(graph, id); + Variable variable = Variables.getPossibleVariable(graph, parameter); if(variable == null) return null; // System.err.println("EVENT " + variable.getURI(graph)); @@ -29,7 +27,7 @@ public class HandleEventRequest implements Read { if(handler instanceof AbstractEventHandler) return (AbstractEventHandler) handler; else - throw new DatabaseException("Handler for " + id + " is not instance of AbstractEventHandler (it is instance of " + (handler != null ? handler.getClass() : null) + ")"); + throw new DatabaseException("Handler for " + parameter + " is not instance of AbstractEventHandler (it is instance of " + (handler != null ? handler.getClass() : null) + ")"); } } \ No newline at end of file