Examples of SimpleBindings


Examples of javax.script.SimpleBindings

        factory.enterContext();
    }

    @Override
    public Bindings createBindings() {
        return new SimpleBindings();
    }
View Full Code Here

Examples of javax.script.SimpleBindings

    private Map<ScriptEngineManager, ClassLoader> classLoaders;
    private BundleContext context;

    public OSGiScriptEngineManager(BundleContext context) {
        this.context = context;
        bindings = new SimpleBindings();
        this.classLoaders = findManagers(context);
    }
View Full Code Here

Examples of javax.script.SimpleBindings

        ScriptContext scriptContext = new SimpleScriptContext();
        ScriptHelper helper = createScriptHelper(scriptContext);
        if (helper != null) {
            localContext.put(SCRIPT_HELPER_KEY, helper);
        }
        Bindings bindings = new SimpleBindings(localContext);
        scriptContext.setBindings(bindings, ScriptContext.ENGINE_SCOPE);
        return scriptContext;
    }
View Full Code Here

Examples of javax.script.SimpleBindings

                if (scriptEngine == null) {
                    throw new SerializationException("Script engine for \"" + language + "\" not found.");
                }

                // Don't pollute the engine namespace with the listener functions
                scriptEngine.setBindings(new SimpleBindings(), ScriptContext.ENGINE_SCOPE);

                try {
                    scriptEngine.eval(script);
                } catch (ScriptException exception) {
                    reportException(exception, script);
View Full Code Here

Examples of javax.script.SimpleBindings

            Object result = null;

            String methodName = method.getName();
            if (methodName.equals(event)) {
                try {
                    SimpleBindings bindings = new SimpleBindings();
                    bindings.put(ARGUMENTS_KEY, args);
                    scriptEngine.setBindings(bindings, ScriptContext.ENGINE_SCOPE);
                    scriptEngine.eval(script);
                } catch (ScriptException exception) {
                    reportException(exception, script);
                }
View Full Code Here

Examples of javax.script.SimpleBindings

    }
    return scriptEngineFactory;
  }

  public Bindings createBindings() {
    return new SimpleBindings();
  }
View Full Code Here

Examples of javax.script.SimpleBindings

  private void executeScript() {
    if (scriptEngine != null) {
      try {
        String environment = SpinScriptEnv.get(scriptEngine.getFactory().getLanguageName());

        Bindings bindings = new SimpleBindings(variables);
        LOG.executeScriptWithScriptEngine(scriptPath, scriptEngine.getFactory().getEngineName());
        scriptEngine.eval(environment, bindings);
        scriptEngine.eval(script, bindings);
      } catch (ScriptException e) {
        throw LOG.scriptExecutionError(scriptPath, e);
View Full Code Here

Examples of javax.script.SimpleBindings

        CompiledScript script = calloutCache_.get(callout);
        if ( script != null )
        {
            try
            {
                Bindings binding = new SimpleBindings();
                binding.put("args", args);
                result = script.eval(binding);
            }
            catch(ScriptException ex)
            {
                logger_.warn(LogUtil.throwableToString(ex));
View Full Code Here

Examples of javax.script.SimpleBindings

        this.globalBindings = globalBindings;
        this.scriptEngines = createScriptEngines();
    }

    public CompletableFuture<Object> eval(final String script) {
        return eval(script, Optional.empty(), new SimpleBindings());
    }
View Full Code Here

Examples of javax.script.SimpleBindings

    public CompletableFuture<Object> eval(final String script, final Bindings boundVars) {
        return eval(script, Optional.empty(), boundVars);
    }

    public CompletableFuture<Object> eval(final String script, final Map<String, Object> boundVars) {
        return eval(script, Optional.empty(), new SimpleBindings(boundVars));
    }
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.