MCPcopy Create free account
hub / github.com/apache/pig / getInstance

Method getInstance

src/org/apache/pig/scripting/ScriptEngine.java:281–294  ·  view source on GitHub ↗

Gets instance of the scriptEngine for the given scripting language @param scriptingLang ScriptEngine classname or keyword for the scriptingLang @return scriptengine for the given scripting language @throws IOException

(String scriptingLang)

Source from the content-addressed store, hash-verified

279 * @throws IOException
280 */
281 public static ScriptEngine getInstance(String scriptingLang)
282 throws IOException {
283 String scriptingEngine = scriptingLang;
284 try {
285 if (SupportedScriptLang.contains(scriptingLang)) {
286 SupportedScriptLang supportedScriptLang = SupportedScriptLang.valueOf(scriptingLang);
287 scriptingEngine = supportedScriptLang.getEngineClassName();
288 }
289 return (ScriptEngine) Class.forName(scriptingEngine).newInstance();
290 } catch (Exception e) {
291 throw new IOException("Could not load ScriptEngine: "
292 + scriptingEngine + " for "+scriptingLang+" (Supported langs: "+SupportedScriptLang.supportedScriptLangs+") : " + e, e);
293 }
294 }
295
296 /**
297 * Runs a script file.

Callers 7

varargTestMethod · 0.95
firstTestMethod · 0.95
testTCMethod · 0.95
runScriptMethod · 0.95
registerCodeMethod · 0.95
runEmbeddedScriptMethod · 0.95

Calls 2

containsMethod · 0.95
getEngineClassNameMethod · 0.95

Tested by 5

varargTestMethod · 0.76
firstTestMethod · 0.76
testTCMethod · 0.76
runScriptMethod · 0.76