KEYCLOAK-5131 ProviderFactory::postInit not called with hot deployment
This commit is contained in:
parent
7010c39544
commit
fba264433a
1 changed files with 5 additions and 0 deletions
|
@ -112,6 +112,7 @@ public class DefaultKeycloakSessionFactory implements KeycloakSessionFactory, Pr
|
|||
public void deploy(ProviderManager pm) {
|
||||
Map<Class<? extends Provider>, Map<String, ProviderFactory>> copy = getFactoriesCopy();
|
||||
Map<Class<? extends Provider>, Map<String, ProviderFactory>> newFactories = loadFactories(pm);
|
||||
List<ProviderFactory> deployed = new LinkedList<>();
|
||||
List<ProviderFactory> undeployed = new LinkedList<>();
|
||||
|
||||
for (Map.Entry<Class<? extends Provider>, Map<String, ProviderFactory>> entry : newFactories.entrySet()) {
|
||||
|
@ -120,6 +121,7 @@ public class DefaultKeycloakSessionFactory implements KeycloakSessionFactory, Pr
|
|||
copy.put(entry.getKey(), entry.getValue());
|
||||
} else {
|
||||
for (ProviderFactory f : entry.getValue().values()) {
|
||||
deployed.add(f);
|
||||
ProviderFactory old = current.remove(f.getId());
|
||||
if (old != null) undeployed.add(old);
|
||||
}
|
||||
|
@ -131,6 +133,9 @@ public class DefaultKeycloakSessionFactory implements KeycloakSessionFactory, Pr
|
|||
for (ProviderFactory factory : undeployed) {
|
||||
factory.close();
|
||||
}
|
||||
for (ProviderFactory factory : deployed) {
|
||||
factory.postInit(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue