public class DefaultFuture extends Object implements ResponseFuture
| 构造器和说明 |
|---|
DefaultFuture(Channel channel,
Request request,
int timeout) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
cancel() |
static void |
closeChannel(Channel channel)
close a channel when a channel is inactive
directly return the unfinished requests.
|
Object |
get()
get result.
|
Object |
get(int timeout)
get result with the specified timeout.
|
static DefaultFuture |
getFuture(long id) |
Request |
getRequest() |
static boolean |
hasFuture(Channel channel) |
boolean |
isDone()
check is done.
|
static void |
received(Channel channel,
Response response) |
static void |
sent(Channel channel,
Request request) |
void |
setCallback(ResponseCallback callback)
set callback.
|
public static DefaultFuture getFuture(long id)
public static boolean hasFuture(Channel channel)
public static void closeChannel(Channel channel)
channel - channel to closepublic Object get() throws RemotingException
ResponseFutureget 在接口中 ResponseFutureRemotingExceptionpublic Object get(int timeout) throws RemotingException
ResponseFutureget 在接口中 ResponseFuturetimeout - timeout.RemotingExceptionpublic void cancel()
public boolean isDone()
ResponseFutureisDone 在接口中 ResponseFuturepublic void setCallback(ResponseCallback callback)
ResponseFuturesetCallback 在接口中 ResponseFuturepublic Request getRequest()
Copyright © 2011–2018 The Apache Software Foundation. All rights reserved.