/** * Get the class of the scriptName in question, so that you can instantiate Groovy objects with caching and reloading. * * @param scriptName resource name pointing to the script * @return the loaded scriptName as a compiled class * @throws ResourceException if there is a problem accessing the script * @throws ScriptException if there is a problem parsing the script */ public Class loadScriptByName(String scriptName) throws ResourceException, ScriptException { scriptName = scriptName.replace('.', File.separatorChar) + ".groovy"; ScriptCacheEntry entry = updateCacheEntry(scriptName); return entry.scriptClass; }
/** * Get the class of the scriptName in question, so that you can instantiate Groovy objects with caching and reloading. * * @param scriptName resource name pointing to the script * @return the loaded scriptName as a compiled class * @throws ResourceException if there is a problem accessing the script * @throws ScriptException if there is a problem parsing the script */ public Class loadScriptByName(String scriptName) throws ResourceException, ScriptException { scriptName = scriptName.replace('.', File.separatorChar) + ".groovy"; ScriptCacheEntry entry = updateCacheEntry(scriptName); return entry.scriptClass; }
/** * Get the class of the scriptName in question, so that you can instantiate Groovy objects with caching and reloading. * * @param scriptName resource name pointing to the script * @return the loaded scriptName as a compiled class * @throws ResourceException if there is a problem accessing the script * @throws ScriptException if there is a problem parsing the script */ public Class loadScriptByName(String scriptName) throws ResourceException, ScriptException { scriptName = scriptName.replace('.', File.separatorChar) + ".groovy"; ScriptCacheEntry entry = updateCacheEntry(scriptName); return entry.scriptClass; }
/** * Creates a Script with a given scriptName and binding. * * @param scriptName name of the script to run * @param binding the binding to pass to the script * @return the script object * @throws ResourceException if there is a problem accessing the script * @throws ScriptException if there is a problem parsing the script */ public Script createScript(String scriptName, Binding binding) throws ResourceException, ScriptException { ScriptCacheEntry entry = updateCacheEntry(scriptName); scriptName = scriptName.intern(); return InvokerHelper.createScript(entry.scriptClass, binding); }
/** * Creates a Script with a given scriptName and binding. * * @param scriptName name of the script to run * @param binding the binding to pass to the script * @return the script object * @throws ResourceException if there is a problem accessing the script * @throws ScriptException if there is a problem parsing the script */ public Script createScript(String scriptName, Binding binding) throws ResourceException, ScriptException { ScriptCacheEntry entry = updateCacheEntry(scriptName); scriptName = scriptName.intern(); return InvokerHelper.createScript(entry.scriptClass, binding); }
/** * Creates a Script with a given scriptName and binding. * * @param scriptName name of the script to run * @param binding the binding to pass to the script * @return the script object * @throws ResourceException if there is a problem accessing the script * @throws ScriptException if there is a problem parsing the script */ public Script createScript(String scriptName, Binding binding) throws ResourceException, ScriptException { ScriptCacheEntry entry = updateCacheEntry(scriptName); scriptName = scriptName.intern(); return InvokerHelper.createScript(entry.scriptClass, binding); }