public class HSFResponseFuture extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static ThreadLocal<Future<Object>> |
future |
static ThreadLocal<com.taobao.hsf.tbremoting.invoke.HSFFutureListener> |
listener |
| 构造器和说明 |
|---|
HSFResponseFuture() |
| 限定符和类型 | 方法和说明 |
|---|---|
static HSFFuture |
getFuture() |
static Object |
getResponse(long timeout)
获取远程对象的结果。
|
static void |
setFuture(Future<Object> future)
设置Future方式的调用,不需要应用调用
|
static void |
setFutureListener(com.taobao.hsf.tbremoting.invoke.HSFFutureListener listener) |
public static ThreadLocal<Future<Object>> future
public static ThreadLocal<com.taobao.hsf.tbremoting.invoke.HSFFutureListener> listener
public static Object getResponse(long timeout) throws HSFException, InterruptedException
如果指定的时间用完但还没有收到响应,则返回ResponseFuture.ASYN_NOT_DONE
timeout - 超时时间HSFExceptionInterruptedExceptionpublic static HSFFuture getFuture() throws HSFException
HSFExceptionpublic static void setFutureListener(com.taobao.hsf.tbremoting.invoke.HSFFutureListener listener)
Copyright © 2016. All rights reserved.