@Test public void testSetGlobalValue() throws Exception { System.out.println(" setGlobalValue"); final String varName = "foo"; final String varValue = "a global value"; EnvFunction.setGlobalValue(varName, varValue); class Task implements Runnable { public void run() { Object result = ff.function("env", ff.literal(varName)).evaluate(null); assertEquals(varValue, result.toString()); } } Future f1 = executor.submit(new Task()); Future f2 = executor.submit(new Task()); f1.get(); f2.get(); }
public static void setGlobalValue(String name, Object value) { globalLookup.put(name.toUpperCase(), value); }
EnvFunction extends FunctionExpressionImpl { public static void setGlobalValue(String name, Object value) { globalLookup.put(name.toUpperCase(), value); } }
EnvFunction extends FunctionExpressionImpl { public static void setGlobalValue(String name, Object value) { globalLookup.put(name.toUpperCase(), value); } EnvFunction(); }
EnvFunction extends FunctionExpressionImpl { public static void setGlobalValue(String name, Object value) { globalLookup.put(name.toUpperCase(), value); } EnvFunction(); static void setLocalValues(Map<String, Object> values); static void clearLocalValues(); static void setGlobalValues(Map<String, Object> values); static void clearGlobalValues(); static void setLocalValue(String name, Object value); static void setGlobalValue(String name, Object value); @Override int getArgCount(); @Override Object evaluate(Object feature); @Override void setParameters(List params); @Override void setFallbackValue(Literal fallback); }
EnvFunction extends FunctionExpressionImpl { public static void setGlobalValue(String name, Object value) { globalLookup.put(name.toUpperCase(), value); } EnvFunction(); static void setLocalValues(Map<String, Object> values); static void clearLocalValues(); static void setGlobalValues(Map<String, Object> values); static void clearGlobalValues(); static void setLocalValue(String name, Object value); static void setGlobalValue(String name, Object value); @Override int getArgCount(); @Override Object evaluate(Object feature); @Override void setParameters(List params); @Override void setFallbackValue(Literal fallback); static FunctionName NAME; }