Class DefaultInfinispanConnectionProviderFactory
java.lang.Object
org.keycloak.connections.infinispan.DefaultInfinispanConnectionProviderFactory
- All Implemented Interfaces:
InfinispanConnectionProviderFactory
,ProviderEventListener
,ProviderFactory<InfinispanConnectionProvider>
,ServerInfoAwareProviderFactory
public class DefaultInfinispanConnectionProviderFactory
extends Object
implements InfinispanConnectionProviderFactory, ProviderEventListener, ServerInfoAwareProviderFactory
- Author:
- Stian Thorgersen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
This is called when the server shuts down.create
(KeycloakSession session) protected org.infinispan.manager.EmbeddedCacheManager
protected org.infinispan.client.hotrod.RemoteCacheManager
createRemoteCacheManager
(KeycloakSession session) Optional method used to declare that a ProviderFactory has a dependency on one or more Providers.protected org.infinispan.configuration.cache.Configuration
Deprecated, for removal: This API element is subject to removal in a future version.getId()
protected org.infinispan.configuration.cache.Configuration
Deprecated, for removal: This API element is subject to removal in a future version.not used anymoreReturn actual info about the provider.void
init
(Config.Scope config) Only called once when the factory is first created.protected org.infinispan.manager.EmbeddedCacheManager
initContainerManaged
(org.infinispan.manager.EmbeddedCacheManager cacheManager) Deprecated, for removal: This API element is subject to removal in a future version.not invoked anymore.protected org.infinispan.manager.EmbeddedCacheManager
Deprecated, for removal: This API element is subject to removal in a future version.not used anymore.boolean
Checks if the cluster health check is supported.boolean
Detects network split in the cluster.protected InfinispanConnectionProvider
lazyInit
(KeycloakSession keycloakSession) void
onEvent
(ProviderEvent event) void
postInit
(KeycloakSessionFactory factory) Called after all provider factories have been initializedstatic void
static void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.keycloak.provider.ProviderFactory
getConfigMetadata, order
-
Constructor Details
-
DefaultInfinispanConnectionProviderFactory
public DefaultInfinispanConnectionProviderFactory()
-
-
Method Details
-
create
- Specified by:
create
in interfaceProviderFactory<InfinispanConnectionProvider>
-
runWithReadLockOnCacheManager
-
runWithWriteLockOnCacheManager
-
close
public void close()Description copied from interface:ProviderFactory
This is called when the server shuts down.- Specified by:
close
in interfaceProviderFactory<InfinispanConnectionProvider>
-
getId
- Specified by:
getId
in interfaceProviderFactory<InfinispanConnectionProvider>
-
init
Description copied from interface:ProviderFactory
Only called once when the factory is first created.- Specified by:
init
in interfaceProviderFactory<InfinispanConnectionProvider>
-
postInit
Description copied from interface:ProviderFactory
Called after all provider factories have been initialized- Specified by:
postInit
in interfaceProviderFactory<InfinispanConnectionProvider>
-
lazyInit
-
createEmbeddedCacheManager
protected org.infinispan.manager.EmbeddedCacheManager createEmbeddedCacheManager(KeycloakSession session) -
createRemoteCacheManager
protected org.infinispan.client.hotrod.RemoteCacheManager createRemoteCacheManager(KeycloakSession session) -
initContainerManaged
@Deprecated(since="26.0", forRemoval=true) protected org.infinispan.manager.EmbeddedCacheManager initContainerManaged(org.infinispan.manager.EmbeddedCacheManager cacheManager) Deprecated, for removal: This API element is subject to removal in a future version.not invoked anymore. OverwritecreateEmbeddedCacheManager(KeycloakSession)
. -
initEmbedded
@Deprecated(since="26.3", forRemoval=true) protected org.infinispan.manager.EmbeddedCacheManager initEmbedded()Deprecated, for removal: This API element is subject to removal in a future version.not used anymore. OverwritecreateEmbeddedCacheManager(KeycloakSession)
if you want to create a customEmbeddedCacheManager
. -
getKeysCacheConfig
@Deprecated(since="26.3", forRemoval=true) protected org.infinispan.configuration.cache.Configuration getKeysCacheConfig()Deprecated, for removal: This API element is subject to removal in a future version.not used anymore -
getCrlCacheConfig
@Deprecated(since="26.3", forRemoval=true) protected org.infinispan.configuration.cache.Configuration getCrlCacheConfig()Deprecated, for removal: This API element is subject to removal in a future version. -
dependsOn
Description copied from interface:ProviderFactory
Optional method used to declare that a ProviderFactory has a dependency on one or more Providers. If a Provider is declared here, it is guaranteed that the dependenciesProviderFactory.postInit(org.keycloak.models.KeycloakSessionFactory)
method will be executed before this ProviderFactory'sProviderFactory.postInit(org.keycloak.models.KeycloakSessionFactory)
. Similarly, it's guaranteed thatProviderFactory.close()
will be called on thisProviderFactory
beforeProviderFactory.close()
is called on any of the dependent ProviderFactory implementations.- Specified by:
dependsOn
in interfaceProviderFactory<InfinispanConnectionProvider>
-
onEvent
- Specified by:
onEvent
in interfaceProviderEventListener
-
getOperationalInfo
Description copied from interface:ServerInfoAwareProviderFactory
Return actual info about the provider. This info contains information about provider's configuration and operational conditions (eg. errors in connection to remote systems etc) which is shown on "Server Info" page then.- Specified by:
getOperationalInfo
in interfaceServerInfoAwareProviderFactory
- Returns:
- Map with keys describing value and relevant values itself
-
isClusterHealthy
public boolean isClusterHealthy()Description copied from interface:InfinispanConnectionProviderFactory
Detects network split in the cluster.If a possible network split is detected and this node does not belong to the winning partition, this method will return
false
, and should not continue handling requests, to keep data safety.- Specified by:
isClusterHealthy
in interfaceInfinispanConnectionProviderFactory
- Returns:
true
if the cluster is healthy and this node can continue processing requests. Whenfalse
, this node must reject any work.
-
isClusterHealthSupported
public boolean isClusterHealthSupported()Description copied from interface:InfinispanConnectionProviderFactory
Checks if the cluster health check is supported.Not all JGroups configurations support discovering network splits and this method signals if the current in use configuration can detect those.
- Specified by:
isClusterHealthSupported
in interfaceInfinispanConnectionProviderFactory
- Returns:
true
if the cluster health check is supported.
-
CacheConfigurator.getCrlCacheConfig()