Class BaseCacheInitializer
- java.lang.Object
-
- org.keycloak.models.sessions.infinispan.initializer.CacheInitializer
-
- org.keycloak.models.sessions.infinispan.initializer.BaseCacheInitializer
-
- Direct Known Subclasses:
InfinispanCacheInitializer
public abstract class BaseCacheInitializer extends CacheInitializer
- Author:
- Marek Posolda
-
-
Field Summary
Fields Modifier and Type Field Description protected KeycloakSessionFactory
sessionFactory
protected SessionLoader
sessionLoader
protected int
sessionsPerSegment
protected String
stateKey
protected org.infinispan.Cache<String,Serializable>
workCache
-
Constructor Summary
Constructors Constructor Description BaseCacheInitializer(KeycloakSessionFactory sessionFactory, org.infinispan.Cache<String,Serializable> workCache, SessionLoader sessionLoader, String stateKeySuffix, int sessionsPerSegment)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
getProgressIndicator()
Returns an integer which captures current progress.protected InitializerState
getStateFromCache()
org.infinispan.Cache<String,Serializable>
getWorkCache()
protected boolean
isCoordinator()
protected boolean
isFinished()
protected void
saveStateToCache(InitializerState state)
-
Methods inherited from class org.keycloak.models.sessions.infinispan.initializer.CacheInitializer
getStalledTimeoutInSeconds, initCache, loadSessions, startLoading
-
-
-
-
Field Detail
-
sessionFactory
protected final KeycloakSessionFactory sessionFactory
-
workCache
protected final org.infinispan.Cache<String,Serializable> workCache
-
sessionLoader
protected final SessionLoader sessionLoader
-
sessionsPerSegment
protected final int sessionsPerSegment
-
stateKey
protected final String stateKey
-
-
Constructor Detail
-
BaseCacheInitializer
public BaseCacheInitializer(KeycloakSessionFactory sessionFactory, org.infinispan.Cache<String,Serializable> workCache, SessionLoader sessionLoader, String stateKeySuffix, int sessionsPerSegment)
-
-
Method Detail
-
isFinished
protected boolean isFinished()
- Specified by:
isFinished
in classCacheInitializer
-
isCoordinator
protected boolean isCoordinator()
- Specified by:
isCoordinator
in classCacheInitializer
-
getProgressIndicator
protected int getProgressIndicator()
Description copied from class:CacheInitializer
Returns an integer which captures current progress. If there is a progress in loading, this indicator must be different most of the time so that it does not hit 30-seconds limit.- Specified by:
getProgressIndicator
in classCacheInitializer
- Returns:
- See Also:
#stalledTimeoutInSeconds
-
getStateFromCache
protected InitializerState getStateFromCache()
-
saveStateToCache
protected void saveStateToCache(InitializerState state)
-
getWorkCache
public org.infinispan.Cache<String,Serializable> getWorkCache()
-
-