class ThreadStepInterruptionPolicy implements StepInterruptionPolicy {

	protected static final Log logger = LogFactory.getLog(ThreadStepInterruptionPolicy.class);

	/**
	 * Returns if the current job lifecycle has been interrupted by checking if the
	 * current thread is interrupted.
	 */
	@Override
	public void checkInterrupted(StepExecution stepExecution) throws JobInterruptedException {<FILL_FUNCTION_BODY>}

	/**
	 * @param stepExecution the current context
	 * @return true if the job has been interrupted
	 */
	private boolean isInterrupted(StepExecution stepExecution) {
		boolean interrupted = Thread.currentThread().isInterrupted();
		if (interrupted) {
			logger.info("Step interrupted through Thread API");
		}
		else {
			interrupted = stepExecution.isTerminateOnly();
			if (interrupted) {
				logger.info("Step interrupted through StepExecution");
			}
		}
		return interrupted;
	}

}


		if (isInterrupted(stepExecution)) {
			throw new JobInterruptedException("Job interrupted status detected.");
		}

	
<no_super_class>