Class DefaultScriptEngineResolver

    • Constructor Detail

      • DefaultScriptEngineResolver

        public DefaultScriptEngineResolver​(ScriptEngineManager scriptEngineManager)
    • Method Detail

      • getScriptEngine

        public ScriptEngine getScriptEngine​(String language,
                                            boolean resolveFromCache)
        Returns a cached script engine or creates a new script engine if no such engine is currently cached.
        Specified by:
        getScriptEngine in interface ScriptEngineResolver
        language - the language (such as 'groovy' for the script engine)
        the cached engine or null if no script engine can be created for the given language
      • getJavaScriptScriptEngine

        protected ScriptEngine getJavaScriptScriptEngine​(String language)
      • isCachable

        protected boolean isCachable​(ScriptEngine scriptEngine)
        Allows checking whether the script engine can be cached.
        scriptEngine - the script engine to check.
        true if the script engine may be cached.
      • configureScriptEngines

        protected void configureScriptEngines​(String language,
                                              ScriptEngine scriptEngine)
      • configureGroovyScriptEngine

        protected void configureGroovyScriptEngine​(ScriptEngine scriptEngine)
        Allows providing custom configuration for the groovy script engine.
        scriptEngine - the groovy script engine to configure.
      • configureGraalJsScriptEngine

        protected void configureGraalJsScriptEngine​(ScriptEngine scriptEngine)
        Allows providing custom configuration for the Graal JS script engine.
        scriptEngine - the Graal JS script engine to configure.