本文整理匯總了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);
}
}