[KEYCLOAK-12909] - Keycloak uses embedded cache manager instead of container-managed one
This commit is contained in:
parent
b6c5acef25
commit
199e5dfa3e
4 changed files with 9 additions and 3 deletions
|
@ -29,6 +29,7 @@
|
||||||
<module name="org.keycloak.keycloak-core"/>
|
<module name="org.keycloak.keycloak-core"/>
|
||||||
<module name="org.keycloak.keycloak-server-spi"/>
|
<module name="org.keycloak.keycloak-server-spi"/>
|
||||||
<module name="org.keycloak.keycloak-server-spi-private"/>
|
<module name="org.keycloak.keycloak-server-spi-private"/>
|
||||||
|
<module name="org.keycloak.keycloak-wildfly-extensions" export="true" services="import"/>
|
||||||
<module name="org.infinispan"/>
|
<module name="org.infinispan"/>
|
||||||
<module name="org.infinispan.commons"/>
|
<module name="org.infinispan.commons"/>
|
||||||
<module name="org.infinispan.persistence.remote"/>
|
<module name="org.infinispan.persistence.remote"/>
|
||||||
|
|
|
@ -101,7 +101,7 @@ public class DefaultInfinispanConnectionProviderFactory implements InfinispanCon
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
if (cacheManager == null) {
|
if (cacheManager == null) {
|
||||||
EmbeddedCacheManager managedCacheManager = null;
|
EmbeddedCacheManager managedCacheManager = null;
|
||||||
Iterator<ManagedCacheManagerProvider> providers = ServiceLoader.load(ManagedCacheManagerProvider.class)
|
Iterator<ManagedCacheManagerProvider> providers = ServiceLoader.load(ManagedCacheManagerProvider.class, DefaultInfinispanConnectionProvider.class.getClassLoader())
|
||||||
.iterator();
|
.iterator();
|
||||||
|
|
||||||
if (providers.hasNext()) {
|
if (providers.hasNext()) {
|
||||||
|
@ -115,6 +115,9 @@ public class DefaultInfinispanConnectionProviderFactory implements InfinispanCon
|
||||||
}
|
}
|
||||||
|
|
||||||
if (managedCacheManager == null) {
|
if (managedCacheManager == null) {
|
||||||
|
if (!config.getBoolean("embedded", false)) {
|
||||||
|
throw new RuntimeException("No " + ManagedCacheManagerProvider.class.getName() + " found. If running in embedded mode set the [embedded] property to this provider.");
|
||||||
|
}
|
||||||
initEmbedded();
|
initEmbedded();
|
||||||
} else {
|
} else {
|
||||||
initContainerManaged(managedCacheManager);
|
initContainerManaged(managedCacheManager);
|
||||||
|
|
|
@ -140,7 +140,8 @@
|
||||||
"remoteStoreEnabled": "${keycloak.connectionsInfinispan.remoteStoreEnabled:false}",
|
"remoteStoreEnabled": "${keycloak.connectionsInfinispan.remoteStoreEnabled:false}",
|
||||||
"remoteStoreHost": "${keycloak.connectionsInfinispan.remoteStoreServer:localhost}",
|
"remoteStoreHost": "${keycloak.connectionsInfinispan.remoteStoreServer:localhost}",
|
||||||
"remoteStorePort": "${keycloak.connectionsInfinispan.remoteStorePort:11222}",
|
"remoteStorePort": "${keycloak.connectionsInfinispan.remoteStorePort:11222}",
|
||||||
"hotrodProtocolVersion": "${keycloak.connectionsInfinispan.hotrodProtocolVersion}"
|
"hotrodProtocolVersion": "${keycloak.connectionsInfinispan.hotrodProtocolVersion}",
|
||||||
|
"embedded": "${keycloak.connectionsInfinispan.embedded:true}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,8 @@
|
||||||
"remoteStoreEnabled": "${keycloak.connectionsInfinispan.remoteStoreEnabled:false}",
|
"remoteStoreEnabled": "${keycloak.connectionsInfinispan.remoteStoreEnabled:false}",
|
||||||
"remoteStoreHost": "${keycloak.connectionsInfinispan.remoteStoreServer:localhost}",
|
"remoteStoreHost": "${keycloak.connectionsInfinispan.remoteStoreServer:localhost}",
|
||||||
"remoteStorePort": "${keycloak.connectionsInfinispan.remoteStorePort:11222}",
|
"remoteStorePort": "${keycloak.connectionsInfinispan.remoteStorePort:11222}",
|
||||||
"hotrodProtocolVersion": "${keycloak.connectionsInfinispan.hotrodProtocolVersion}"
|
"hotrodProtocolVersion": "${keycloak.connectionsInfinispan.hotrodProtocolVersion}",
|
||||||
|
"embedded": "${keycloak.connectionsInfinispan.embedded:true}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue