Interface CompiledScriptCache

All Known Implementing Classes:
LRUNonThreadSafeCompiledScriptCache, LRUThreadSafeCompiledScriptCache

public interface CompiledScriptCache
A compiled script cache. Allows to get a compiled script from the cache, and out it back.
Author:
kimchy
  • Method Details

    • get

      Object get(String name, LocalScriptExecutor executor, Script script) throws ScriptCompilationException
      Gets the compiled script from the cache. Compiles it if a new instance is needed using the provided local executor.
      Parameters:
      name - The name (key) in the cache.
      executor - The executor to use to compile the script.
      script - The script to compile
      Returns:
      A compiled script from the cache
      Throws:
      ScriptCompilationException
    • put

      void put(String name, Object compiledScript, LocalScriptExecutor executor)
      Puts a compiled script back to the cache.
      Parameters:
      name - The name (key) in the cache)
      compiledScript - The compiled script to put back in the cache.
      executor - The executor to use in order to close any evicted compiled scripts from the cache