本文整理了Java中java.util.concurrent.CancellationException.getStackTrace()
方法的一些代码示例,展示了CancellationException.getStackTrace()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。CancellationException.getStackTrace()
方法的具体详情如下:
包路径:java.util.concurrent.CancellationException
类名称:CancellationException
方法名:getStackTrace
暂无
代码示例来源:origin: wildfly/wildfly
@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";
代码示例来源:origin: wildfly/wildfly
@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
代码示例来源:origin: wildfly/wildfly
@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";
代码示例来源:origin: wildfly/wildfly
@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";
代码示例来源:origin: google/guava
@GwtIncompatible
public void testImmediateCancelledFutureStack() throws Exception {
ListenableFuture<String> future = CallerClass1.makeImmediateCancelledFuture();
assertTrue(future.isCancelled());
try {
CallerClass2.get(future);
fail();
} catch (CancellationException expected) {
// There should be two CancellationException chained together. The outer one should have the
// stack trace of where the get() call was made, and the inner should have the stack trace of
// where the immediateCancelledFuture() call was made.
List<StackTraceElement> stackTrace = ImmutableList.copyOf(expected.getStackTrace());
assertFalse(Iterables.any(stackTrace, hasClassName(CallerClass1.class)));
assertTrue(Iterables.any(stackTrace, hasClassName(CallerClass2.class)));
// See AbstractFutureCancellationCauseTest for how to set causes.
assertThat(expected.getCause()).isNull();
}
}
代码示例来源:origin: wildfly/wildfly-core
@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]";
代码示例来源:origin: org.jboss.eap/wildfly-client-all
@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
代码示例来源:origin: org.jboss.threads/jboss-threads
@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";
代码示例来源:origin: wildfly/jboss-ejb-client
@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";
代码示例来源:origin: org.jboss.eap/wildfly-client-all
@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";
代码示例来源:origin: org.wildfly.core/wildfly-controller
@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]";
代码示例来源:origin: org.jboss.eap/wildfly-client-all
@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";
代码示例来源:origin: metatron-app/metatron-discovery
StringBuffer sb = new StringBuffer();
for(StackTraceElement ste : ce.getStackTrace()) {
sb.append("\n");
sb.append(ste.toString());
代码示例来源:origin: com.google.guava/guava-tests
@GwtIncompatible
public void testImmediateCancelledFutureStack() throws Exception {
ListenableFuture<String> future = CallerClass1.makeImmediateCancelledFuture();
assertTrue(future.isCancelled());
try {
CallerClass2.get(future);
fail();
} catch (CancellationException expected) {
// There should be two CancellationException chained together. The outer one should have the
// stack trace of where the get() call was made, and the inner should have the stack trace of
// where the immediateCancelledFuture() call was made.
List<StackTraceElement> stackTrace = ImmutableList.copyOf(expected.getStackTrace());
assertFalse(Iterables.any(stackTrace, hasClassName(CallerClass1.class)));
assertTrue(Iterables.any(stackTrace, hasClassName(CallerClass2.class)));
// See AbstractFutureCancellationCauseTest for how to set causes.
assertThat(expected.getCause()).isNull();
}
}
内容来源于网络,如有侵权,请联系作者删除!