org.keycloak.models.sessions.infinispan.initializer

## Class InfinispanCacheInitializer

- java.lang.Object
- - org.keycloak.models.sessions.infinispan.initializer.CacheInitializer
  - - org.keycloak.models.sessions.infinispan.initializer.BaseCacheInitializer
    - - org.keycloak.models.sessions.infinispan.initializer.InfinispanCacheInitializer

-     public class InfinispanCacheInitializer
      extends BaseCacheInitializer

  Startup initialization for reading persistent userSessions to be filled into infinispan/memory . In cluster, the initialization is distributed among all cluster nodes, so the startup time is even faster Implementation is pretty generic and doesn't contain any "userSession" specific stuff. All logic related to how are sessions loaded is in the SessionLoader implementation
  Author:
    Marek Posolda

- - ### Field Summary

    - ### Fields inherited from class org.keycloak.models.sessions.infinispan.initializer.BaseCacheInitializer

      `sessionFactory, sessionLoader, sessionsPerSegment, stateKey, workCache`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `InfinispanCacheInitializer(KeycloakSessionFactory sessionFactory, org.infinispan.Cache<String,Serializable> workCache, SessionLoader sessionLoader, String stateKeySuffix, int sessionsPerSegment, int maxErrors)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `initCache()`
    `protected void` | `startLoading()` Just coordinator will run this
    `protected void` | `startLoadingImpl(InitializerState state, SessionLoader.LoaderContext loaderCtx)`

    - ### Methods inherited from class org.keycloak.models.sessions.infinispan.initializer.BaseCacheInitializer

      `getStateFromCache, getWorkCache, isCoordinator, isFinished, saveStateToCache`

    - ### Methods inherited from class org.keycloak.models.sessions.infinispan.initializer.CacheInitializer

      `loadSessions`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### InfinispanCacheInitializer

          public InfinispanCacheInitializer(KeycloakSessionFactory sessionFactory,
                                            org.infinispan.Cache<String,Serializable> workCache,
                                            SessionLoader sessionLoader,
                                            String stateKeySuffix,
                                            int sessionsPerSegment,
                                            int maxErrors)

  - ### Method Detail

    - #### initCache

          public void initCache()

      Overrides:
        `initCache` in class `CacheInitializer`

    - #### startLoading

          protected void startLoading()

      Description copied from class: `CacheInitializer`
      Just coordinator will run this
      Specified by:
        `startLoading` in class `CacheInitializer`

    - #### startLoadingImpl

          protected void startLoadingImpl(InitializerState state,
                                          SessionLoader.LoaderContext loaderCtx)

Copyright © 2020 JBoss by Red Hat. All rights reserved.