当前位置: 首页>>代码示例>>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;未经允许,请勿转载。