File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed
batch-jberet/src/main/java/org/wildfly/extension/batch/jberet Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -203,4 +203,24 @@ public interface BatchLogger extends BasicLogger {
203203
204204 @ Message (id = 21 , value = "Duplicate virtual file %s." )
205205 IllegalStateException duplicateVirtualFile (VirtualFile file );
206+
207+ /**
208+ * Creates an exception indicating the {@link org.wildfly.extension.batch.jberet.job.repository.JobRepositoryService
209+ * JobRepositoryService} has stopped.
210+ *
211+ * @return an {@link java.lang.IllegalStateException} for the error
212+ */
213+ @ Message (id = 22 , value = "The service JobRepositoryService has been stopped and cannot execute operations." )
214+ IllegalStateException jobRepositoryServiceStopped ();
215+
216+ /**
217+ * Logs an error message indicating that there was a problem
218+ * while stopping the running jobs.
219+ *
220+ * @param cause the cause of the error
221+ * @param deploymentName the name of the deployment
222+ */
223+ @ LogMessage (level = Level .ERROR )
224+ @ Message (id = 23 , value = "Failed to stop running jobs on deployment %s." )
225+ void failedToStopJobs (@ Cause Throwable cause , String deploymentName );
206226}
Original file line number Diff line number Diff line change @@ -488,6 +488,8 @@ private void stopRunningJobs(final boolean queueForRestart) {
488488 }
489489 }
490490 }
491+ } catch (IllegalStateException e ) {
492+ BatchLogger .LOGGER .failedToStopJobs (e , deploymentName );
491493 } finally {
492494 WildFlySecurityManager .setCurrentContextClassLoaderPrivileged (current );
493495 // Reset the stopped state
Original file line number Diff line number Diff line change @@ -227,6 +227,6 @@ private JobRepository getAndCheckDelegate() {
227227 if (started && delegate != null ) {
228228 return delegate ;
229229 }
230- throw BatchLogger .LOGGER .jobOperatorServiceStopped ();
230+ throw BatchLogger .LOGGER .jobRepositoryServiceStopped ();
231231 }
232232}
You can’t perform that action at this time.
0 commit comments