From 1f5fedb0b02ea74507f48377a0d347218e2c9aab Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Thu, 5 Mar 2015 08:55:51 +0100 Subject: [PATCH] Module provider loader --- dependencies/server-all/pom.xml | 6 ++++++ distribution/modules/build.xml | 4 ++++ .../org/keycloak/keycloak-services/main/module.xml | 1 + .../keycloak-wildfly-extensions/main/module.xml | 13 +++++++++++++ integration/pom.xml | 1 + .../wildfly/ModuleProviderLoaderFactory.java | 1 - .../java/org/keycloak/provider/ProviderManager.java | 2 +- 7 files changed, 26 insertions(+), 2 deletions(-) create mode 100755 distribution/modules/src/main/resources/modules/org/keycloak/keycloak-wildfly-extensions/main/module.xml diff --git a/dependencies/server-all/pom.xml b/dependencies/server-all/pom.xml index 339afad74c..43907f6efa 100755 --- a/dependencies/server-all/pom.xml +++ b/dependencies/server-all/pom.xml @@ -217,6 +217,12 @@ + + + org.keycloak + keycloak-wildfly-extensions + ${project.version} + \ No newline at end of file diff --git a/distribution/modules/build.xml b/distribution/modules/build.xml index 0cd950a8a4..28259d5c4e 100755 --- a/distribution/modules/build.xml +++ b/distribution/modules/build.xml @@ -66,6 +66,10 @@ + + + + diff --git a/distribution/modules/src/main/resources/modules/org/keycloak/keycloak-services/main/module.xml b/distribution/modules/src/main/resources/modules/org/keycloak/keycloak-services/main/module.xml index 4cc0d1336f..74e67a7320 100755 --- a/distribution/modules/src/main/resources/modules/org/keycloak/keycloak-services/main/module.xml +++ b/distribution/modules/src/main/resources/modules/org/keycloak/keycloak-services/main/module.xml @@ -47,6 +47,7 @@ + diff --git a/distribution/modules/src/main/resources/modules/org/keycloak/keycloak-wildfly-extensions/main/module.xml b/distribution/modules/src/main/resources/modules/org/keycloak/keycloak-wildfly-extensions/main/module.xml new file mode 100755 index 0000000000..9ccc11e01a --- /dev/null +++ b/distribution/modules/src/main/resources/modules/org/keycloak/keycloak-wildfly-extensions/main/module.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/integration/pom.xml b/integration/pom.xml index 2ccda8e59e..7549c55b90 100755 --- a/integration/pom.xml +++ b/integration/pom.xml @@ -23,6 +23,7 @@ jetty undertow wildfly-adapter + wildfly-extensions keycloak-subsystem keycloak-as7-subsystem js diff --git a/integration/wildfly-extensions/src/main/java/org/keycloak/provider/wildfly/ModuleProviderLoaderFactory.java b/integration/wildfly-extensions/src/main/java/org/keycloak/provider/wildfly/ModuleProviderLoaderFactory.java index cb4a6f19e6..217c203ad9 100644 --- a/integration/wildfly-extensions/src/main/java/org/keycloak/provider/wildfly/ModuleProviderLoaderFactory.java +++ b/integration/wildfly-extensions/src/main/java/org/keycloak/provider/wildfly/ModuleProviderLoaderFactory.java @@ -21,7 +21,6 @@ public class ModuleProviderLoaderFactory implements ProviderLoaderFactory { @Override public ProviderLoader create(ClassLoader baseClassLoader, String resource) { try { - System.out.println("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx"); Module module = Module.getContextModuleLoader().loadModule(ModuleIdentifier.fromString(resource)); ModuleClassLoader classLoader = module.getClassLoader(); return new DefaultProviderLoader(classLoader); diff --git a/services/src/main/java/org/keycloak/provider/ProviderManager.java b/services/src/main/java/org/keycloak/provider/ProviderManager.java index 6a301fd36f..6246d83973 100644 --- a/services/src/main/java/org/keycloak/provider/ProviderManager.java +++ b/services/src/main/java/org/keycloak/provider/ProviderManager.java @@ -20,7 +20,7 @@ public class ProviderManager { public ProviderManager(ClassLoader baseClassLoader, String... resources) { List factories = new LinkedList(); - for (ProviderLoaderFactory f : ServiceLoader.load(ProviderLoaderFactory.class)) { + for (ProviderLoaderFactory f : ServiceLoader.load(ProviderLoaderFactory.class, getClass().getClassLoader())) { factories.add(f); }