ModuleManager: ensure engine module is always present in environment
private ModuleEnvironment environment;
private final ModuleMetadataJsonAdapter metadataReader;
private final ModuleInstallManager installManager;
+ private Module engineModule;
public ModuleManager(String masterServerAddress) {
this(masterServerAddress, Collections.emptyList());
@@ -77,7 +78,7 @@ public ModuleManager(String masterServerAddress, List<Class<?>> classesOnClasspa
metadataReader = newMetadataReader();
- Module engineModule = loadEngineModule(classesOnClasspathsToAddToEngine);
+ engineModule = loadEngineModule(classesOnClasspathsToAddToEngine);
registry = new TableModuleRegistry();
registry.add(engineModule);
@@ -286,6 +287,7 @@ public ModuleEnvironment getEnvironment() {
public ModuleEnvironment loadEnvironment(Set<Module> modules, boolean asPrimary) {
Set<Module> finalModules = Sets.newLinkedHashSet(modules);
+ finalModules.add(engineModule);
ModuleEnvironment newEnvironment;
boolean permissiveSecurityEnabled = Boolean.parseBoolean(System.getProperty(SystemConfig.PERMISSIVE_SECURITY_ENABLED_PROPERTY));
if (permissiveSecurityEnabled) {
