]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling/src/org/simantics/modeling/scl/OntologyModuleSourceRepository.java
(refs #7604) Improvements to graph handling in SCL source modules
[simantics/platform.git] / bundles / org.simantics.modeling / src / org / simantics / modeling / scl / OntologyModuleSourceRepository.java
index 1e9df2e192ae1a2fe0f9ab952ce4e3c15eb313fb..b91e90d61c42ce83f8ccb8f3ecb74d8cdb80ff87 100644 (file)
@@ -12,7 +12,6 @@ import org.simantics.scl.compiler.module.repository.UpdateListener;
 import org.simantics.scl.compiler.source.ModuleSource;
 import org.simantics.scl.compiler.source.PrecompiledModuleSource;
 import org.simantics.scl.compiler.source.repository.ModuleSourceRepository;
-import org.simantics.scl.runtime.SCLContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -42,14 +41,8 @@ public enum OntologyModuleSourceRepository implements ModuleSourceRepository {
         if(!moduleName.startsWith("http://"))
             return null; // Don't do a graph request if this cannot be a resource
         
-        ReadGraph graph = (ReadGraph)SCLContext.getCurrent().get("graph");
-        
         try {
-            if(graph != null) {
-                return new PrecompiledModuleSource(new OntologyModule(graph, moduleName), -1.0);
-            }
-
-            return Simantics.getSession().syncRequest(new ModuleSourceRequest(moduleName));
+            return Simantics.getAvailableRequestProcessor().syncRequest(new ModuleSourceRequest(moduleName));
         } catch(DatabaseException e) {
             LOGGER.error("Failed to read ontology module " + moduleName + ".", e);
             return null;