use of org.keycloak.provider.EnvironmentDependentProviderFactory 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