Permalink
Browse files

Register module against Language Util.

  • Loading branch information...
1 parent 5eed196 commit 01d9cd02c536759f4dc11804a53424bda80f55a2 @alesj alesj committed with FroMage Feb 17, 2013
Showing with 15 additions and 2 deletions.
  1. +15 −2 impl/src/main/java/ceylon/modules/jboss/runtime/CeylonModuleLoader.java
@@ -37,6 +37,7 @@
import com.redhat.ceylon.common.Versions;
import org.jboss.modules.DependencySpec;
import org.jboss.modules.LocalLoader;
+import org.jboss.modules.Module;
import org.jboss.modules.ModuleIdentifier;
import org.jboss.modules.ModuleLoadException;
import org.jboss.modules.ModuleLoader;
@@ -102,6 +103,7 @@
}
private RepositoryManager repository;
+ private Map<ModuleIdentifier, ArtifactResult> artifacts = new ConcurrentHashMap<ModuleIdentifier, ArtifactResult>();
private Map<ModuleIdentifier, List<DependencySpec>> dependencies = new ConcurrentHashMap<ModuleIdentifier, List<DependencySpec>>();
private Graph<ModuleIdentifier, ModuleIdentifier, Boolean> graph = new Graph<ModuleIdentifier, ModuleIdentifier, Boolean>();
@@ -166,7 +168,14 @@ private void relink(ModuleIdentifier mi, Set<ModuleIdentifier> visited) throws M
if (BOOTSTRAP.contains(mi))
return org.jboss.modules.Module.getBootModuleLoader().loadModule(mi);
- return super.preloadModule(mi);
+ final Module module = super.preloadModule(mi);
+
+ if (module != null) {
+ ArtifactResult result = artifacts.get(mi);
+ // com.redhat.ceylon.compiler.java.Util.loadModule(mi.getName(), mi.getSlot(), result, SecurityActions.getClassLoader(module))
+ }
+
+ return module;
}
/**
@@ -277,7 +286,11 @@ protected ModuleSpec findModule(ModuleIdentifier moduleIdentifier) throws Module
dependencies.put(moduleIdentifier, deps);
- return builder.create();
+ ModuleSpec moduleSpec = builder.create();
+ // add on successful spec build
+ artifacts.put(moduleIdentifier, artifact);
+
+ return moduleSpec;
} catch (Exception e) {
throw new ModuleLoadException(e);
}

0 comments on commit 01d9cd0

Please sign in to comment.