@Override public void open(ExecutionContext executionContext) throws ItemStreamException { super.open(executionContext); try { doOpen(); } catch (Exception e) { throw new ItemStreamException("Failed to initialize the writer", e); } if (!isSaveState()) { return; } if (executionContext.containsKey(getExecutionContextKey(WRITE_COUNT_MAX))) { maxItemCount = executionContext.getInt(getExecutionContextKey(WRITE_COUNT_MAX)); } if (executionContext.containsKey(getExecutionContextKey(WRITE_COUNT))) { int itemCount = executionContext.getInt(getExecutionContextKey(WRITE_COUNT)); currentItemCount = itemCount; if (itemCount < maxItemCount) { try { jumpToItem(itemCount); } catch (Exception e) { throw new ItemStreamException("Could not move to stored position on restart", e); } } } }