本文整理汇总了Java中java.util.concurrent.ExecutionException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java ExecutionException.getMessage方法的具体用法?Java ExecutionException.getMessage怎么用?Java ExecutionException.getMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.concurrent.ExecutionException
的用法示例。
在下文中一共展示了ExecutionException.getMessage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: get
import java.util.concurrent.ExecutionException; //导入方法依赖的package包/类
@Override
public ClusterNode get() throws InterruptedException, LeaderException {
try {
return super.get();
} catch (ExecutionException e) {
throw new LeaderException(e.getMessage(), e.getCause());
}
}
示例2: getUninterruptedly
import java.util.concurrent.ExecutionException; //导入方法依赖的package包/类
@Override
public ClusterNode getUninterruptedly() throws LeaderException {
try {
return super.getUninterruptedly();
} catch (ExecutionException e) {
throw new LeaderException(e.getMessage(), e.getCause());
}
}
示例3: get
import java.util.concurrent.ExecutionException; //导入方法依赖的package包/类
@Override
public CoordinationProcess get() throws InterruptedException, CoordinationException {
try {
return super.get();
} catch (ExecutionException e) {
throw new CoordinationException(e.getMessage(), e);
}
}
示例4: getUninterruptedly
import java.util.concurrent.ExecutionException; //导入方法依赖的package包/类
@Override
public CoordinationProcess getUninterruptedly() throws CoordinationException {
try {
return super.getUninterruptedly();
} catch (ExecutionException e) {
throw new CoordinationException(e.getMessage(), e);
}
}
示例5: timedCall
import java.util.concurrent.ExecutionException; //导入方法依赖的package包/类
private <T> T timedCall(final CallRunner1<T> callRunner)
throws TimeoutException, InterruptedException, StreamingException {
Future<T> future = callTimeoutPool.submit(new Callable<T>() {
@Override
public T call() throws StreamingException, InterruptedException, Failure {
return callRunner.call();
}
});
try {
if (callTimeout > 0) {
return future.get(callTimeout, TimeUnit.MILLISECONDS);
} else {
return future.get();
}
} catch (TimeoutException eT) {
future.cancel(true);
sinkCounter.incrementConnectionFailedCount();
throw eT;
} catch (ExecutionException e1) {
sinkCounter.incrementConnectionFailedCount();
Throwable cause = e1.getCause();
if (cause instanceof IOException) {
throw new StreamingException("I/O Failure", (IOException) cause);
} else if (cause instanceof StreamingException) {
throw (StreamingException) cause;
} else if (cause instanceof TimeoutException) {
throw new StreamingException("Operation Timed Out.", (TimeoutException) cause);
} else if (cause instanceof RuntimeException) {
throw (RuntimeException) cause;
} else if (cause instanceof InterruptedException) {
throw (InterruptedException) cause;
}
throw new StreamingException(e1.getMessage(), e1);
}
}