1 package org.simantics.scl.compiler.runtime;
3 import org.simantics.scl.compiler.environment.Environment;
5 import gnu.trove.map.hash.THashMap;
7 public class RuntimeEnvironmentImpl implements RuntimeEnvironment {
9 private final Environment environment;
10 private final THashMap<String, RuntimeModule> runtimeModuleMap;
11 private final ClassLoader parentClassLoader;
12 private MutableClassLoader classLoader;
14 public RuntimeEnvironmentImpl(Environment environment,
15 ClassLoader parentClassLoader,
16 THashMap<String, RuntimeModule> runtimeModuleMap) {
17 this.environment = environment;
18 this.parentClassLoader = parentClassLoader;
19 this.runtimeModuleMap = runtimeModuleMap;
23 public Environment getEnvironment() {
28 public RuntimeModule getRuntimeModule(String name) {
29 return runtimeModuleMap.get(name);
33 public synchronized MutableClassLoader getMutableClassLoader() {
34 if(classLoader == null)
35 classLoader = new ExpressionClassLoader(
36 parentClassLoader, runtimeModuleMap, "Expression");