@Override public Integer call() throws Exception { if (script == null) { throw new NullPointerException("No script."); } GroovyShell shell = new GroovyShell(classLoader, binding); evalResult = shell.evaluate(script); if (binding.hasVariable(OddjobWriteBinding.ODDJOB_RESULT_BINDING)) { Object result = binding.getVariable(OddjobWriteBinding.ODDJOB_RESULT_BINDING); if (result instanceof Number) { return ((Number) result).intValue(); } } return 0; }
@HardReset @SoftReset @Destroy public void reset() { binding.reset(); }