Examples of RhinoScriptEngine


Examples of org.rhq.scripting.javascript.engine.RhinoScriptEngine

            throw new IllegalArgumentException("Provided script engine cannot be handled by " + this.getClass()
                + ". Expected " + RhinoScriptEngine.class + " but got "
                + (scriptEngine == null ? "null" : scriptEngine.getClass().getName()));
        }

        RhinoScriptEngine eng = (RhinoScriptEngine) scriptEngine;

        if (scriptSourceProvider != null) {
            eng.setModuleSourceProvider(new ScriptSourceToModuleSourceProviderAdapter(scriptSourceProvider));
        }
    }
View Full Code Here

Examples of org.rhq.scripting.javascript.engine.RhinoScriptEngine

        return errorMessage;
    }

    private ScriptEngine instantiateUnsecured(Set<String> packages)
        throws ScriptException {
        RhinoScriptEngine eng = (RhinoScriptEngine) engineManager.getEngineByName("rhino-nonjdk");
       
        if (eng == null) {
            throw new IllegalStateException("Failed to instantiate the 'rhino-nonjdk' script engine. This means that either the required library is missing from the classpath or that there are some security issues preventing it from being instantiated.");
        }
       
        for (String pkg : packages) {
            eng.eval("importPackage(" + pkg + ")");
        }

        return eng;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.