T
- 模板参数public class DmsRequestFuture<T>
extends java.lang.Object
构造器和说明 |
---|
DmsRequestFuture() |
限定符和类型 | 方法和说明 |
---|---|
void |
fail(java.lang.Throwable t)
失败调用
|
T |
get()
调用get会阻塞等待结果响应
|
T |
get(long time,
java.util.concurrent.TimeUnit timeUnit)
调用get会阻塞等待结果响应,最长等待指定时间
|
void |
success(T res)
成功响应
|
public T get() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
java.lang.InterruptedException
- InterruptedExceptionjava.util.concurrent.ExecutionException
- 执行结果错误,会引发此异常public T get(long time, java.util.concurrent.TimeUnit timeUnit) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
time
- 等待最长时间timeUnit
- 时间单位java.lang.InterruptedException
- InterruptedExceptionjava.util.concurrent.ExecutionException
- 执行结果错误,会引发此异常java.util.concurrent.TimeoutException
- 等待超时异常public void success(T res)
res
- 响应结果public void fail(java.lang.Throwable t)
t
- 异常信息