@Override public void onRetryWriteException(List<Object> items, Exception ex) throws Exception { try { retryWriteListener.onRetryWriteException(items, ex); } catch (Exception e) { throw new BatchRuntimeException(e); } }
@Override public final BatchRuntimeException noBatchEnvironmentFound(final ClassLoader cl) { final BatchRuntimeException result = new BatchRuntimeException(String.format(getLoggingLocale(), noBatchEnvironmentFound$str(), cl)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String unauthorized = "WFLYBATCH000020: Permission denied. User %s does not have %s permissions.";
@Override public Response toResponse(final BatchRuntimeException e) { return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build(); } }
@Override public boolean isComplete(RepeatContext context) { try { isComplete = policy.isReadyToCheckpoint(); return isComplete; } catch (Exception e) { throw new BatchRuntimeException(e); } }
@Override public final BatchRuntimeException failToInjectProperty(final Throwable th, final String v, final Field f) { final BatchRuntimeException result = new BatchRuntimeException(String.format(getLoggingLocale(), failToInjectProperty$str(), v, f), th); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String failToLookupDataSource = "JBERET000621: Failed to look up datasource by jndi name %s.";
@Override public RepeatContext start(RepeatContext parent) { try { policy.beginCheckpoint(); } catch (Exception e) { throw new BatchRuntimeException(e); } return parent; }
@Override public final BatchRuntimeException failToLookupDataSource(final Throwable cause, final String dataSourceName) { final BatchRuntimeException result = new BatchRuntimeException(String.format(getLoggingLocale(), failToLookupDataSource$str(), dataSourceName), cause); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String failToObtainConnection1 = "JBERET000622: Failed to obtain connection from %s";
@SuppressWarnings("unchecked") @Override public void onWriteError(Exception exception, List<? extends S> items) { try { delegate.onWriteError((List<Object>) items, exception); } catch (Exception e) { throw new BatchRuntimeException(e); } } }
@Override public final BatchRuntimeException cannotHaveBothNextAttributeAndElement(final Location location, final String nextAttributeValue) { final BatchRuntimeException result = new BatchRuntimeException(String.format(getLoggingLocale(), cannotHaveBothNextAttributeAndElement$str(), location, nextAttributeValue)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String jobInstanceAlreadyExists = "JBERET000630: The job instance: %s already exists in the job repository and cannot be added again.";
@Override public void onReadError(Exception ex) { try { delegate.onReadError(ex); } catch (Exception e) { throw new BatchRuntimeException(e); } } }
@Override public final BatchRuntimeException cannotHaveBothScriptAndRef(final String ref) { final BatchRuntimeException result = new BatchRuntimeException(String.format(getLoggingLocale(), cannotHaveBothScriptAndRef$str(), ref)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String invalidScriptAttributes = "JBERET000637: Invalid script attributes: type = %s, src = %s";
@Override public void onRetryProcessException(Object item, Exception ex) throws Exception { try { retryProcessListener.onRetryProcessException(item, ex); } catch (Exception e) { throw new BatchRuntimeException(e); } }
@Override public final BatchRuntimeException failToCreateCacheManager(final Throwable th, final String description) { final BatchRuntimeException result = new BatchRuntimeException(String.format(getLoggingLocale(), failToCreateCacheManager$str(), description), th); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String failToGetNextId = "JBERET000643: Failed to get next id number: %s";
@SuppressWarnings("unchecked") @Override public void afterWrite(List<? extends S> items) { try { delegate.afterWrite((List<Object>) items); } catch (Exception e) { throw new BatchRuntimeException(e); } }
@Override public final BatchRuntimeException splitExecutionTimeout(final String splitId, final long timeoutSeconds) { final BatchRuntimeException result = new BatchRuntimeException(String.format(getLoggingLocale(), splitExecutionTimeout$str(), splitId, timeoutSeconds)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String noSuchJobInstance = "JBERET000645: No job instance %s";
@Override public void beforeJob(JobExecution jobExecution) { try { delegate.beforeJob(); } catch (Exception e) { throw new BatchRuntimeException(e); } }
@Override public final BatchRuntimeException noBatchEnvironmentFound(final ClassLoader cl) { final BatchRuntimeException result = new BatchRuntimeException(String.format(getLoggingLocale(), noBatchEnvironmentFound$str(), cl)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String unauthorized = "WFLYBATCH000020: Permission denied. User %s does not have %s permissions.";
@Override public boolean isComplete(RepeatContext context, RepeatStatus result) { try { isComplete = policy.isReadyToCheckpoint(); return isComplete; } catch (Exception e) { throw new BatchRuntimeException(e); } }
@Override public final BatchRuntimeException failToObtainConnection(final Throwable cause, final Object connectionSource, final Object props) { final BatchRuntimeException result = new BatchRuntimeException(String.format(getLoggingLocale(), failToObtainConnection2$str(), connectionSource, props), cause); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String failToLoadSqlProperties = "JBERET000623: Failed to load sql properties %s";
@Override public void stop() { try { batchlet.stop(); } catch (Exception e) { throw new BatchRuntimeException(e); } } }