/** * If the <code>ExecutionException</code> is caused by an <code>InterruptedException</code>, * throw the <code>CancellationException</code> instead. */ @Override public Object get() throws InterruptedException, ExecutionException { if (Thread.interrupted()) throw new InterruptedException(); try { return super.get(); } catch (ExecutionException ex) { for (Throwable cause = ex.getCause(); cause != null; cause = cause.getCause()) { if (cause instanceof InterruptedException) { // We interrupted the runnable but we don't want the thread // that called get() to think that the runnable was interrupted. CancellationException ex2 = new CancellationException( "by interrupt"); ex2.setStackTrace(cause.getStackTrace()); throw ex2; } } throw ex; } }
@Override public final CancellationException requestCancelled() { final CancellationException result = new CancellationException(String.format(getLoggingLocale(), requestCancelled$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String timedOut = "EJBCLIENT000403: Timed out";
@Override public final CancellationException opCancelled() { final CancellationException result = new CancellationException(String.format(getLoggingLocale(), opCancelled$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } @Override
@Override public final CancellationException operationCancelled() { final CancellationException result = new CancellationException(String.format(getLoggingLocale(), operationCancelled$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String operationFailed = "JBTHR00005: Operation failed";
@Override public final CancellationException taskWasCancelled() { final CancellationException result = new CancellationException(String.format(getLoggingLocale(), taskWasCancelled$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String methodNotImplemented = "WFLYEJB0206: Not implemented yet";
@Override public final CancellationException serviceInstallCancelled() { final CancellationException result = new CancellationException(String.format(getLoggingLocale(), serviceInstallCancelled$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String servicesMissing = "is missing [%s]";
/** * If the <code>ExecutionException</code> is caused by an * <code>InterruptedException</code>, throw the * <code>CancellationException</code> instead. */ @Override public Object get() throws InterruptedException, ExecutionException { if (Thread.interrupted()) throw new InterruptedException(); try { return super.get(); } catch (ExecutionException ex) { for (Throwable cause = ex.getCause(); cause != null; cause = cause.getCause()) { if (cause instanceof InterruptedException) { // We interrupted the runnable but we don't want the thread // that called get to think he was interrupted. CancellationException ex2 = new CancellationException(LocalizedStrings.AdminDistributedSystemImpl_BY_INTERRUPT.toLocalizedString()); ex2.setStackTrace(cause.getStackTrace()); throw ex2; } } throw ex; } }
/** * If the <code>ExecutionException</code> is caused by an * <code>InterruptedException</code>, throw the * <code>CancellationException</code> instead. */ @Override public Object get() throws InterruptedException, ExecutionException { if (Thread.interrupted()) throw new InterruptedException(); try { return super.get(); } catch (ExecutionException ex) { for (Throwable cause = ex.getCause(); cause != null; cause = cause.getCause()) { if (cause instanceof InterruptedException) { // We interrupted the runnable but we don't want the thread // that called get to think he was interrupted. CancellationException ex2 = new CancellationException(LocalizedStrings.AdminDistributedSystemImpl_BY_INTERRUPT.toLocalizedString()); ex2.setStackTrace(cause.getStackTrace()); throw ex2; } } throw ex; } }
@Override public final CancellationException operationCancelled() { final CancellationException result = new CancellationException(String.format(getLoggingLocale(), operationCancelled$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String operationFailed = "JBTHR00005: Operation failed";
@Override public final CancellationException opCancelled() { final CancellationException result = new CancellationException(String.format(getLoggingLocale(), opCancelled$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } @Override
@Override public final CancellationException serviceInstallCancelled() { final CancellationException result = new CancellationException(String.format(getLoggingLocale(), serviceInstallCancelled$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String servicesMissing = "is missing [%s]";
@Override public final CancellationException operationCancelled() { final CancellationException result = new CancellationException(String.format(getLoggingLocale(), operationCancelled$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String operationFailed = "JBTHR00005: Operation failed";
@Override public final CancellationException requestCancelled() { final CancellationException result = new CancellationException(String.format(getLoggingLocale(), requestCancelled$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String timedOut = "EJBCLIENT000403: Timed out";
@Override public final CancellationException requestCancelled() { final CancellationException result = new CancellationException(String.format(getLoggingLocale(), requestCancelled$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String timedOut = "EJBCLIENT000403: Timed out";