Skip to content

Commit

Permalink
Use Forge JBoss Modules - fix ServiceLoader bug in ForgeModuleSpec de…
Browse files Browse the repository at this point in the history
…finition
  • Loading branch information
lincolnthree committed Jan 2, 2013
1 parent e0f27c0 commit b4f4ceb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.jboss.forge.container.AddonRegistry;
import org.jboss.forge.container.AddonRepository;
import org.jboss.forge.container.Forge;
import org.jboss.forge.container.ForgeImpl;
import org.jboss.forge.container.Status;
import org.jboss.forge.container.impl.AddonRepositoryImpl;
import org.jboss.forge.container.util.ClassLoaders;
Expand Down Expand Up @@ -272,8 +273,8 @@ public void run()
@Override
public Object call() throws Exception
{
forge = ServiceLoader.load(Forge.class).iterator().next();
forge.setServerMode(true).setAddonDir(addonDir).start();
forge = new ForgeImpl();
forge.setServerMode(true).setAddonDir(addonDir).start(loader);
return forge;
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ public Callable<Object> call() throws Exception
{
addon.setStatus(Status.STARTING);

ResourceLoader loader = new ModuleResourceLoader(addon.getModule());
ModularURLScanner scanner = new ModularURLScanner(loader, "META-INF/beans.xml");
ResourceLoader resourceLoader = new ModuleResourceLoader(addon.getModule());
ModularURLScanner scanner = new ModularURLScanner(resourceLoader, "META-INF/beans.xml");
ModuleScanResult scanResult = scanner.scan();

if (scanResult.getDiscoveredResourceUrls().isEmpty())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ protected void configure(ModuleLoader loader, Builder builder)
builder.addDependency(DependencySpec.createSystemDependencySpec(
PathFilters.acceptAll(),
PathFilters.any(Arrays.asList(
PathFilters.is("META-INF/services"),
PathFilters.is("org/jboss/forge/container"),
PathFilters.isChildOf("org/jboss/forge/container"),
PathFilters.is("net/sf/cglib"), PathFilters.isChildOf("net/sf/cglib"))),
Expand Down

0 comments on commit b4f4ceb

Please sign in to comment.