java.util.concurrent.CancellationException.getStackTrace()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(217)

本文整理了Java中java.util.concurrent.CancellationException.getStackTrace()方法的一些代码示例,展示了CancellationException.getStackTrace()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。CancellationException.getStackTrace()方法的具体详情如下:
包路径:java.util.concurrent.CancellationException
类名称:CancellationException
方法名:getStackTrace

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();
 }
}

相关文章