com.alibaba.dubbo.remoting.exchange.support
Class DefaultFuture

java.lang.Object
  extended by com.alibaba.dubbo.remoting.exchange.support.DefaultFuture
All Implemented Interfaces:
ResponseFuture

public class DefaultFuture
extends Object
implements ResponseFuture

DefaultFuture.

Author:
qian.lei, chao.liuc

Constructor Summary
DefaultFuture(Channel channel, Request request, int timeout)
           
 
Method Summary
 void cancel()
           
 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultFuture

public DefaultFuture(Channel channel,
                     Request request,
                     int timeout)
Method Detail

getFuture

public static DefaultFuture getFuture(long id)

hasFuture

public static boolean hasFuture(Channel channel)

sent

public static void sent(Channel channel,
                        Request request)

received

public static void received(Channel channel,
                            Response response)

get

public Object get()
           throws RemotingException
Description copied from interface: ResponseFuture
get result.

Specified by:
get in interface ResponseFuture
Returns:
result.
Throws:
RemotingException

get

public Object get(int timeout)
           throws RemotingException
Description copied from interface: ResponseFuture
get result with the specified timeout.

Specified by:
get in interface ResponseFuture
Parameters:
timeout - timeout.
Returns:
result.
Throws:
RemotingException

cancel

public void cancel()

isDone

public boolean isDone()
Description copied from interface: ResponseFuture
check is done.

Specified by:
isDone in interface ResponseFuture
Returns:
done or not.

setCallback

public void setCallback(ResponseCallback callback)
Description copied from interface: ResponseFuture
set callback.

Specified by:
setCallback in interface ResponseFuture

getRequest

public Request getRequest()


Copyright © 2012–2017 Alibaba. All rights reserved.