Interface CompiledScriptPool

All Known Implementing Classes:
BlockingQueueCompiledScriptPool

public interface CompiledScriptPool
Represnts a pool of compiled scripts that should work with a non thread safe compiled scripts in conjuction with CompiledScriptCache.
Author:
kimchy
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes the pool.
    get()
    Returns a compiled script from the pool.
    void
    init(LocalScriptExecutor executor, Script script)
    Inits the pool by compiling zero or more scripts.
    void
    put(Object compiledScript)
    Puts back a compiled script to the pool.
  • Method Details

    • init

      void init(LocalScriptExecutor executor, Script script) throws ScriptingException
      Inits the pool by compiling zero or more scripts. This is benefitial when we have a pool and we wish to initialize it with a pre set of compiled scripts.

      Also, the local executor and the script can be store for later compilatation and shutdowm.

      Parameters:
      executor - The local script executor to compile the script and close it.
      script - The script to compile.
      Throws:
      ScriptingException
    • get

      Returns a compiled script from the pool.
      Throws:
      ScriptingException
    • put

      void put(Object compiledScript) throws ScriptingException
      Puts back a compiled script to the pool.
      Throws:
      ScriptingException
    • close

      void close()
      Closes the pool. Note, compiled scripts in the pool should be closed.