Package org.keycloak.provider
Interface ProviderFactory<T extends Provider>
- All Known Subinterfaces:
ComponentFactory<CreatedType,,ProviderType> HostnameProviderFactory,LocaleSelectorProviderFactory,LocaleUpdaterProviderFactory,SimpleValidator,SubComponentFactory<CreatedType,,ProviderType> ThemeResourceProviderFactory,ThemeSelectorProviderFactory,ValidatorFactory,VaultProviderFactory
- All Known Implementing Classes:
AbstractSimpleValidator,AbstractStringValidator
public interface ProviderFactory<T extends Provider>
At boot time, keycloak discovers all factories. For each discovered factory, the init() method is called. After
all factories have been initialized, the postInit() method is called. close() is called when the server shuts down.
Only one instance of a factory exists per server.
- Author:
- Stian Thorgersen
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()This is called when the server shuts down.create(KeycloakSession session) Optional method used to declare that a ProviderFactory has a dependency on one or more Providers.default List<ProviderConfigProperty>Returns the metadata for each configuration property supported by this factory.getId()voidinit(Config.Scope config) Only called once when the factory is first created.default intorder()voidpostInit(KeycloakSessionFactory factory) Called after all provider factories have been initialized
-
Method Details
-
create
-
init
Only called once when the factory is first created. This config is pulled from keycloak_server.json- Parameters:
config-
-
postInit
Called after all provider factories have been initialized -
close
void close()This is called when the server shuts down. -
getId
String getId() -
order
default int order() -
getConfigMetadata
Returns the metadata for each configuration property supported by this factory.- Returns:
- a list with the metadata for each configuration property supported by this factory
-
dependsOn
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 dependenciespostInit(org.keycloak.models.KeycloakSessionFactory)method will be executed before this ProviderFactory'spostInit(org.keycloak.models.KeycloakSessionFactory). Similarly, it's guaranteed thatclose()will be called on thisProviderFactorybeforeclose()is called on any of the dependent ProviderFactory implementations.
-