Package javax.script

Examples of javax.script.ScriptEngineManager

     * @param languageShortName The short name of the scripting engine of interest
     * @return the ScriptEngine corresponding to the supplied short name or null if no engine was found
     * @since 1.8.0
    public static ScriptEngine $static_propertyMissing(ScriptEngineManager self, String languageShortName) {
        ScriptEngineManager manager = new ScriptEngineManager();
        return manager.getEngineByName(languageShortName);
View Full Code Here

    Iterator<String> iterator = map.keySet().iterator();
    while(iterator.hasNext()) {
    scriptEngineManager = new ScriptEngineManager();
View Full Code Here

import javax.script.ScriptEngineManager;

public class JavascriptEventPredicateEngine  extends ScriptEventPredicateEngine {
    public JavascriptEventPredicateEngine() {
        super(new ScriptEngineManager().getEngineByName("JavaScript"));
View Full Code Here

  public ScriptInstance(String scriptlanguage) {
    languageId = scriptlanguage;
    logger.debug("the language id is " + scriptlanguage);

    ScriptEngineManager sm;
    ScriptEngine se;
    Bindings sb;
    try {
      sm = new ScriptEngineManager();
      se = sm.getEngineByName(getLanguageId());
      sb = se.getBindings(ScriptContext.ENGINE_SCOPE);
    catch (Exception e) {
      throw new UnsupportedScriptLanguageException(e, "Scriptlanguage " + getLanguageId() + " is not supported.", scriptlanguage);
View Full Code Here

    new TestScripting();

  public TestScripting() throws Exception
    mgr = new ScriptEngineManager();
    jsEngine = mgr.getEngineByExtension(SCRIPT_ENGINE_NAME);

    // InputStream is = this.getClass().getResourceAsStream("js.js");
    File file = new File(SCRIPT_FILE_NAME);
    InputStream is = new BufferedInputStream(new FileInputStream(file));
View Full Code Here

  private static final Log logger = LogFactory.getLog(JavaScriptConfigParser.class);

  private ConfigService configService;

  public void parseConfig(ConfigFile configFile) {
    ScriptEngineManager factory = new ScriptEngineManager();
    ScriptEngine engine = factory.getEngineByName("JavaScript");
    String content = configFile.getContent();
    engine.put("config", this);
    try {
    } catch (ScriptException e) {
View Full Code Here

    private Dictionary<String, String> props;
    private ComponentContext ctx;
    private final JmxScriptBindingsProvider jmxScriptBindingsProvider = new JmxScriptBindingsProvider();

    private void assertExpression(String expression, String languageExtension, boolean expected) throws Exception {
        final ScriptEngine rhino = new ScriptEngineManager().getEngineByExtension("js");
        assertNotNull("With the rhino jar in our classpath, we should get a js script engine", rhino);
        final ScriptEngineManager manager = Mockito.mock(ScriptEngineManager.class);
        final Field f = hc.getClass().getDeclaredField("scriptEngineManager");
        f.set(hc, manager);
        props.put(ScriptableHealthCheck.PROP_EXPRESSION, expression);
View Full Code Here


        ScriptEngineManagerFactory factory = new ScriptEngineManagerFactory();

        ScriptEngineManager first = factory.getScriptEngineManager();


        final Bundle bundle  = context.mock(Bundle.class);

        final File factoryFile = createFactoryFile();

        context.checking(new Expectations() {{



        factory.bundleChanged(new BundleEvent(BundleEvent.STARTED, bundle));

        ScriptEngineManager second = factory.getScriptEngineManager();

View Full Code Here

    public void printConfiguration(final PrintWriter pw) {
        pw.println("Available Script Engines");

        ScriptEngineManager manager = scriptEngineManagerFactory.getScriptEngineManager();
        List<?> factories = manager.getEngineFactories();
        for (Iterator<?> fi = factories.iterator(); fi.hasNext();) {

            final ScriptEngineFactory factory = (ScriptEngineFactory);

View Full Code Here

public class ScriptEngineFactories {
    private static Logger log = Logger.getLogger(ScriptEngineFactories.class.getName());
    public static void main(String[] args) {
        List<ScriptEngineFactory> factories =
            new ScriptEngineManager().getEngineFactories();
        for (ScriptEngineFactory factory : factories) {
  "lang name: " + factory.getLanguageName());
  "lang version: " + factory.getLanguageVersion());
  "engine version: " + factory.getEngineVersion());
  "engine name: " + factory.getEngineName());
View Full Code Here


Related Classes of javax.script.ScriptEngineManager

Copyright © 2018 www.massapicom. 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