@Override public void stop() { StopLock stopLock = getStopLock(); // Store in local variable to facilitate Ctrl+Shift+G search in Eclipse synchronized (stopLock) { if ( isStepStartingOrStarted() ) { markStepStopping(); // Possible for stop() to come before process(). See comment above. if (batchletProxy != null) { batchletProxy.stop(); } } else { // Might not be set up yet to have a state. logger.fine("Ignoring stop, since step not in a state which has a valid status (might not be far enough along to have a state yet)"); } } }
@Override public synchronized void stop() { // It is possible for stop() to be issued before process() if (BatchStatus.STARTING.equals(stepContext.getBatchStatus()) || BatchStatus.STARTED.equals(stepContext.getBatchStatus())) { stepContext.setBatchStatus(BatchStatus.STOPPING); if (batchletProxy != null) { batchletProxy.stop(); } } else { //TODO do we need to throw an error if the batchlet is already stopping/stopped //a stop gets issued twice } }
@Override public synchronized void stop() { // It is possible for stop() to be issued before process() if (BatchStatus.STARTING.equals(stepContext.getBatchStatus()) || BatchStatus.STARTED.equals(stepContext.getBatchStatus())) { stepContext.setBatchStatus(BatchStatus.STOPPING); if (batchletProxy != null) { batchletProxy.stop(); } } else { //TODO do we need to throw an error if the batchlet is already stopping/stopped //a stop gets issued twice } }