/** * Initialize the reader. This method may be called multiple times before * close is called. * * @see ItemStream#open(ExecutionContext) */ @Override public void open(ExecutionContext executionContext) throws ItemStreamException { super.open(executionContext); Assert.notNull(resource, "The resource must be set"); if (!getOutputState().isInitialized()) { doOpen(executionContext); } }
@Override public void open(ExecutionContext executionContext) throws ItemStreamException { super.open(executionContext); resourceIndex = executionContext.getInt(getExecutionContextKey(RESOURCE_INDEX_KEY), 1); currentResourceItemCount = executionContext.getInt(getExecutionContextKey(CURRENT_RESOURCE_ITEM_COUNT), 0); try { setResourceToDelegate(); } catch (IOException e) { throw new ItemStreamException("Couldn't assign resource", e); } if (executionContext.containsKey(getExecutionContextKey(CURRENT_RESOURCE_ITEM_COUNT))) { // It's a restart delegate.open(executionContext); opened = true; } else { opened = false; } }
@Override public void open(ExecutionContext executionContext) { super.open(executionContext);
/** * Initialize the reader. This method may be called multiple times before * close is called. * * @see ItemStream#open(ExecutionContext) */ @Override public void open(ExecutionContext executionContext) throws ItemStreamException { super.open(executionContext); Assert.notNull(resource, "The resource must be set"); if (!getOutputState().isInitialized()) { doOpen(executionContext); } }
@Override public void open(ExecutionContext executionContext) throws ItemStreamException { super.open(executionContext); resourceIndex = executionContext.getInt(getExecutionContextKey(RESOURCE_INDEX_KEY), 1); currentResourceItemCount = executionContext.getInt(getExecutionContextKey(CURRENT_RESOURCE_ITEM_COUNT), 0); try { setResourceToDelegate(); } catch (IOException e) { throw new ItemStreamException("Couldn't assign resource", e); } if (executionContext.containsKey(getExecutionContextKey(CURRENT_RESOURCE_ITEM_COUNT))) { // It's a restart delegate.open(executionContext); opened = true; } else { opened = false; } }
@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); } } } }
@Override public void open(ExecutionContext executionContext) { super.open(executionContext);