com.alipay.remoting
Interface InvokeFuture

All Known Implementing Classes:
DefaultInvokeFuture

public interface InvokeFuture

The future of an invocation.


Method Summary
 void addTimeout(io.netty.util.Timeout timeout)
          Add timeout for the future.
 void cancelTimeout()
          Cancel the timeout.
 RemotingCommand createConnectionClosedResponse(InetSocketAddress responseHost)
          Create a remoting command response when connection closed
 void executeInvokeCallback()
          Execute the callback.
 ClassLoader getAppClassLoader()
           
 Throwable getCause()
          Get the cause of exception of the future.
 InvokeCallback getInvokeCallback()
          Get the application callback of the future.
 InvokeContext getInvokeContext()
          get invoke context
 byte getProtocolCode()
          Get the protocol code of command.
 int invokeId()
          Get the id of the invocation.
 boolean isDone()
          Whether the future is done.
 void putResponse(RemotingCommand response)
          Put the response to the future.
 void setCause(Throwable cause)
          Set the cause if exception caught.
 void setInvokeContext(InvokeContext invokeContext)
          set invoke context
 void tryAsyncExecuteInvokeCallbackAbnormally()
          Asynchronous execute the callback abnormally.
 RemotingCommand waitResponse()
          Wait response with unlimit timeout
 RemotingCommand waitResponse(long timeoutMillis)
          Wait response with timeout.
 

Method Detail

waitResponse

RemotingCommand waitResponse(long timeoutMillis)
                             throws InterruptedException
Wait response with timeout.

Parameters:
timeoutMillis -
Returns:
Throws:
InterruptedException

waitResponse

RemotingCommand waitResponse()
                             throws InterruptedException
Wait response with unlimit timeout

Returns:
Throws:
InterruptedException

createConnectionClosedResponse

RemotingCommand createConnectionClosedResponse(InetSocketAddress responseHost)
Create a remoting command response when connection closed

Parameters:
responseHost -
Returns:

putResponse

void putResponse(RemotingCommand response)
Put the response to the future.

Parameters:
response -

invokeId

int invokeId()
Get the id of the invocation.

Returns:

executeInvokeCallback

void executeInvokeCallback()
Execute the callback.


tryAsyncExecuteInvokeCallbackAbnormally

void tryAsyncExecuteInvokeCallbackAbnormally()
Asynchronous execute the callback abnormally.


setCause

void setCause(Throwable cause)
Set the cause if exception caught.

Parameters:
cause -

getCause

Throwable getCause()
Get the cause of exception of the future.

Returns:

getInvokeCallback

InvokeCallback getInvokeCallback()
Get the application callback of the future.

Returns:

addTimeout

void addTimeout(io.netty.util.Timeout timeout)
Add timeout for the future.

Parameters:
timeout -

cancelTimeout

void cancelTimeout()
Cancel the timeout.


isDone

boolean isDone()
Whether the future is done.

Returns:

getAppClassLoader

ClassLoader getAppClassLoader()
Returns:
application classloader

getProtocolCode

byte getProtocolCode()
Get the protocol code of command.

Returns:

setInvokeContext

void setInvokeContext(InvokeContext invokeContext)
set invoke context

Parameters:
invokeContext -

getInvokeContext

InvokeContext getInvokeContext()
get invoke context

Returns:


Copyright © 2018. All rights reserved.