class OnJobExecutionFinishedEventListener implements ApplicationListener<JobExecutionEvent> {

    @Override
    public void onApplicationEvent(final JobExecutionEvent jobExecutionEvent) {
        final JobExecution jobExecution = jobExecutionEvent.getJobExecution();
        if (jobExecution != null) {
            log.info(jobExecution.getJobInstance().getJobName() + ", Status: " + jobExecution.getStatus().getBatchStatus() +
                    ", Exit: " + jobExecution.getExitStatus().getExitCode());
            final JobExecutionEventInfo jobExecutionEventInfo =
                    EventTransformer.transformToJobExecutionEventInfo(
                            jobExecution,
                            jobExecutionEvent.getApplicationName());
            this.jobExecutionEventPublisher.publishEvent(jobExecutionEventInfo);
            jobExecution.getStepExecutions()
                    .stream()
                    .map(step -> EventTransformer.transformToStepExecutionEventInfo(step, jobExecutionEvent.getApplicationName()))
                    .forEach(this.stepExecutionEventPublisher::publishEvent);
        } else {
            log.debug("could not fire JobExcutionEvent, exitStatus was null");
        }

    }

    public  OnJobExecutionFinishedEventListener(final JobExecutionEventPublisher jobExecutionEventPublisher, final StepExecutionEventPublisher stepExecutionEventPublisher);

}