Examples of invokeFunction()


Examples of javax.script.Invocable.invokeFunction()

    HashMap<String, String> map = new HashMap<String, String>();
    map.put("keyOne", "valueOne"); //$NON-NLS-2$
    String functionName = "one";
    engine.eval(script);
    Invocable inv = (Invocable) engine;
    inv.invokeFunction(functionName, map);
  }

  @Test
  public void testC() throws ScriptException, NoSuchMethodException {
    ScriptEngineManager manager = new ScriptEngineManager();
View Full Code Here

Examples of javax.script.Invocable.invokeFunction()

    HashMap<String, String[]> map = new HashMap<String, String[]>();
    map.put("keyOne", new String[] { "valueOne" });
    String functionName = "one";
    engine.eval(script);
    Invocable inv = (Invocable) engine;
    inv.invokeFunction(functionName, map);
  }

  @SuppressWarnings("unchecked")
  @Test
  public void testMemCacheHashMap() throws CacheException {
View Full Code Here

Examples of javax.script.Invocable.invokeFunction()

        Object result = compiledScript == null ? engine.eval(scriptContent) : compiledScript.eval();
        if (engine instanceof Invocable) {
            final Invocable invocable = (Invocable) engine;

            try {
                result = invocable.invokeFunction("process");
            } catch (final NoSuchMethodException e) {
                //ignore
            }
        }
View Full Code Here

Examples of javax.script.Invocable.invokeFunction()

                    invocable = (Invocable)scriptEngine;
                } catch (ClassCastException exception) {
                    throw new SerializationException(exception);
                }

                result = invocable.invokeFunction(methodName, args);
            }

            // If the function didn't return a value, return the default
            if (result == null) {
                Class<?> returnType = method.getReturnType();
View Full Code Here

Examples of javax.script.Invocable.invokeFunction()

                    invocable = (Invocable)scriptEngine;
                } catch (ClassCastException exception) {
                    throw new SerializationException(exception);
                }

                result = invocable.invokeFunction(methodName, args);
            }

            // If the function didn't return a value, return the default
            if (result == null) {
                Class<?> returnType = method.getReturnType();
View Full Code Here

Examples of javax.script.Invocable.invokeFunction()

                } catch (ClassCastException exception) {
                    throw new RuntimeException(exception);
                }

                try {
                    value = invocable.invokeFunction(functionName, value);
                } catch (NoSuchMethodException exception) {
                    throw new RuntimeException(exception);
                } catch (ScriptException exception) {
                    throw new RuntimeException(exception);
                }
View Full Code Here

Examples of javax.script.Invocable.invokeFunction()

                    invocable = (Invocable)scriptEngine;
                } catch (ClassCastException exception) {
                    throw new SerializationException(exception);
                }

                result = invocable.invokeFunction(methodName, args);
            }

            // If the function didn't return a value, return the default
            if (result == null) {
                Class<?> returnType = method.getReturnType();
View Full Code Here

Examples of javax.script.Invocable.invokeFunction()

                } catch (ClassCastException exception) {
                    throw new RuntimeException(exception);
                }

                try {
                    value = invocable.invokeFunction(functionName, value);
                } catch (NoSuchMethodException exception) {
                    throw new RuntimeException(exception);
                } catch (ScriptException exception) {
                    throw new RuntimeException(exception);
                }
View Full Code Here

Examples of javax.script.Invocable.invokeFunction()

  @Test
  public void test_nashorn_loading() throws Throwable {
    CodeLoader loader = new CodeLoader();
    ScriptEngine check = loader.nashorn("check");
    Invocable invocable = (Invocable) check;
    assertEquals(42, invocable.invokeFunction("truth"));
    assertEquals(11, invocable.invokeFunction("incr", 10));
  }
}
View Full Code Here

Examples of javax.script.Invocable.invokeFunction()

  public void test_nashorn_loading() throws Throwable {
    CodeLoader loader = new CodeLoader();
    ScriptEngine check = loader.nashorn("check");
    Invocable invocable = (Invocable) check;
    assertEquals(42, invocable.invokeFunction("truth"));
    assertEquals(11, invocable.invokeFunction("incr", 10));
  }
}
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.