class NashornExecutionEngine extends AbstractExecutionEngine {

	@Override
	public ObjectNode execute(ObjectNode data, TransformationFunction transformationFunction)
		throws ScriptException, IOException, NoSuchMethodException {
		initNashornSandbox();
		try {
			//append custom transformation function to wrapper script
			String script = wrapperScript + transformationFunction.getTransformFunction();

			//execute script
			nashornSandbox.eval(script);
			Invocable sandboxedInvocable = nashornSandbox.getSandboxedInvocable();
			String result = (String) sandboxedInvocable.invokeFunction(WRAPPER_FUNCTION, data.toString());
			return (ObjectNode) JsonMapper.getInstance().readTree(result);
		} finally {
			ExecutorService executor = nashornSandbox.getExecutor();
			executor.shutdown();
		}
	}

	public  NashornExecutionEngine();

}