當前位置: 首頁>>代碼示例>>Java>>正文


Java ExecutionException.getMessage方法代碼示例

本文整理匯總了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());
    }
}
 
開發者ID:hekate-io,項目名稱:hekate,代碼行數:9,代碼來源:LeaderFuture.java

示例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());
    }
}
 
開發者ID:hekate-io,項目名稱:hekate,代碼行數:9,代碼來源:LeaderFuture.java

示例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);
    }
}
 
開發者ID:hekate-io,項目名稱:hekate,代碼行數:9,代碼來源:CoordinationFuture.java

示例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);
    }
}
 
開發者ID:hekate-io,項目名稱:hekate,代碼行數:9,代碼來源:CoordinationFuture.java

示例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);
  }
}
 
開發者ID:moueimei,項目名稱:flume-release-1.7.0,代碼行數:37,代碼來源:HiveWriter.java


注:本文中的java.util.concurrent.ExecutionException.getMessage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。