Package com.ericlam.mc.groovier
Interface ScriptCacheManager
public interface ScriptCacheManager
a script cache manager
-
Method Summary
Modifier and TypeMethodDescriptionClass<?>
getScriptOrLoad
(File file, GroovyClassLoader classLoader) get the script class from cache, if not cached, load it and cache itClass<?>
getScriptOrLoad
(String content, GroovyClassLoader classLoader) get the script class from cache, if not cached, load it and cache itboolean
check if the script is cached (with md5 hash mapping)boolean
check if the script is cached (with md5 hash mapping)
-
Method Details
-
isCached
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
check if the script is cached (with md5 hash mapping)- Parameters:
content
- script content- Returns:
- true if cached
-
getScriptOrLoad
get the script class from cache, if not cached, load it and cache it- Parameters:
content
- script contentclassLoader
- groovy class loader- Returns:
- script class
- Throws:
Exception
- error while loading script
-
getScriptOrLoad
get the script class from cache, if not cached, load it and cache it- Parameters:
file
- script fileclassLoader
- groovy class loader- Returns:
- script class
- Throws:
Exception
- error while loading script
-