use of org.keycloak.provider.DefaultProviderLoader in project keycloak by keycloak.
the class FeatureDeployerUtil method loadFactories.
private static void loadFactories(ProviderManager pm) {
KeycloakDeploymentInfo di = KeycloakDeploymentInfo.create().services();
ClassLoader classLoader = DefaultKeycloakSession.class.getClassLoader();
DefaultProviderLoader loader = new DefaultProviderLoader(di, classLoader);
loader.loadSpis().forEach(pm::load);
}
use of org.keycloak.provider.DefaultProviderLoader in project keycloak by keycloak.
the class ModuleProviderLoaderFactory method create.
@Override
public ProviderLoader create(KeycloakDeploymentInfo info, ClassLoader baseClassLoader, String resource) {
try {
Module module = Module.getContextModuleLoader().loadModule(ModuleIdentifier.fromString(resource));
ModuleClassLoader classLoader = module.getClassLoader();
return new DefaultProviderLoader(info, classLoader);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
use of org.keycloak.provider.DefaultProviderLoader in project keycloak by keycloak.
the class FeatureDeployerUtil method loadEnabledEnvironmentFactories.
private static Map<ProviderFactory, Spi> loadEnabledEnvironmentFactories() {
KeycloakDeploymentInfo di = KeycloakDeploymentInfo.create().services();
ClassLoader classLoader = DefaultKeycloakSession.class.getClassLoader();
DefaultProviderLoader loader = new DefaultProviderLoader(di, classLoader);
Map<ProviderFactory, Spi> providerFactories = new HashMap<>();
for (Spi spi : loader.loadSpis()) {
List<ProviderFactory> currentFactories = loader.load(spi);
for (ProviderFactory factory : currentFactories) {
if (factory instanceof EnvironmentDependentProviderFactory) {
if (((EnvironmentDependentProviderFactory) factory).isSupported()) {
providerFactories.put(factory, spi);
}
}
}
}
return providerFactories;
}
Aggregations