Package org.keycloak.cache
Class DefaultLocalCacheProviderFactory
java.lang.Object
org.keycloak.cache.DefaultLocalCacheProviderFactory
- All Implemented Interfaces:
LocalCacheProvider,LocalCacheProviderFactory,Provider,ProviderFactory<LocalCacheProvider>
public class DefaultLocalCacheProviderFactory
extends Object
implements LocalCacheProvider, LocalCacheProviderFactory
The default implementation for
LocalCacheProvider and LocalCacheProviderFactory.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()This is called when the server shuts down.<K,V> LocalCache<K, V> create(LocalCacheConfiguration<K, V> configuration) Creates a newLocalCacheinstance for local caching.create(KeycloakSession session) getId()voidinit(Config.Scope config) Only called once when the factory is first created.voidpostInit(KeycloakSessionFactory factory) Called after all provider factories have been initializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.keycloak.provider.ProviderFactory
dependsOn, getConfigMetadata, order
-
Constructor Details
-
DefaultLocalCacheProviderFactory
public DefaultLocalCacheProviderFactory()
-
-
Method Details
-
create
- Specified by:
createin interfaceProviderFactory<LocalCacheProvider>
-
init
Description copied from interface:ProviderFactoryOnly called once when the factory is first created.- Specified by:
initin interfaceProviderFactory<LocalCacheProvider>
-
postInit
Description copied from interface:ProviderFactoryCalled after all provider factories have been initialized- Specified by:
postInitin interfaceProviderFactory<LocalCacheProvider>
-
getId
- Specified by:
getIdin interfaceProviderFactory<LocalCacheProvider>
-
create
Description copied from interface:LocalCacheProviderCreates a newLocalCacheinstance for local caching.LocalCacheProviderimplementations are not responsible for managing the lifecycle of createdLocalCacheinstances. It is the responsibility ofLocalCacheconsumers to ensure thatLocalCache.close()is called when the cache is no longer required.- Specified by:
createin interfaceLocalCacheProvider- Type Parameters:
K- the type of the cache Keys used for lookupV- the type of the cache Values to be stored- Parameters:
configuration- the desired cache configuration- Returns:
LocalCachea newly created cache
-
close
public void close()Description copied from interface:ProviderFactoryThis is called when the server shuts down.- Specified by:
closein interfaceProvider- Specified by:
closein interfaceProviderFactory<LocalCacheProvider>
-