Interface PlatformProvider


  • public interface PlatformProvider
    • Method Detail

      • onStartup

        void onStartup​(Runnable runnable)
      • onShutdown

        void onShutdown​(Runnable runnable)
      • getTmpDirectory

        File getTmpDirectory()
        Returns:
        tmp directory specific to target platform. Implementation can make sure to create "tmp" directory in case it does not exists. The directory should be usually inside the corresponding server directory. In production, it should not be system directory like "/tmp" .
      • getScriptEngineClassLoader

        ClassLoader getScriptEngineClassLoader​(Config.Scope scriptProviderConfig)
        Returns classloader to load script engine. Classloader should contain the implementation of ScriptEngineFactory and it's definition inside META-INF/services of the jar file(s), which will be provided by this classloader. This method can return null and in that case, the default Keycloak services classloader will be used for load script engine. Note that java versions earlier than 15 always contain the "nashorn" script engine by default on the classpath (it is part of the Java platform itself) and hence for them it is always fine to return null (unless you want to override default engine)
        Parameters:
        scriptProviderConfig - Configuration scope of the "default" provider of "scripting" SPI. It can contain some config properties for the classloader (EG. file path)
        Returns:
        classloader or null