Interface ScriptCacheManager


public interface ScriptCacheManager
a script cache manager
  • Method Summary

    Modifier and Type
    Method
    Description
    get the script class from cache, if not cached, load it and cache it
    getScriptOrLoad(String content, GroovyClassLoader classLoader)
    get the script class from cache, if not cached, load it and cache it
    boolean
    isCached(File content)
    check if the script is cached (with md5 hash mapping)
    boolean
    isCached(String content)
    check if the script is cached (with md5 hash mapping)
  • Method Details

    • isCached

      boolean isCached(File content) throws IOException
      check if the script is cached (with md5 hash mapping)
      Parameters:
      content - script content
      Returns:
      true if cached
      Throws:
      IOException - error while reading text
    • isCached

      boolean isCached(String content)
      check if the script is cached (with md5 hash mapping)
      Parameters:
      content - script content
      Returns:
      true if cached
    • getScriptOrLoad

      Class<?> getScriptOrLoad(String content, GroovyClassLoader classLoader) throws Exception
      get the script class from cache, if not cached, load it and cache it
      Parameters:
      content - script content
      classLoader - groovy class loader
      Returns:
      script class
      Throws:
      Exception - error while loading script
    • getScriptOrLoad

      Class<?> getScriptOrLoad(File file, GroovyClassLoader classLoader) throws Exception
      get the script class from cache, if not cached, load it and cache it
      Parameters:
      file - script file
      classLoader - groovy class loader
      Returns:
      script class
      Throws:
      Exception - error while loading script