public class DefaultInvokeFuture extends Object implements InvokeFuture
| Constructor and Description |
|---|
DefaultInvokeFuture(int invokeId,
InvokeCallbackListener callbackListener,
InvokeCallback callback,
byte protocol,
CommandFactory commandFactory)
Constructor.
|
DefaultInvokeFuture(int invokeId,
InvokeCallbackListener callbackListener,
InvokeCallback callback,
byte protocol,
CommandFactory commandFactory,
InvokeContext invokeContext)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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()
Get application classloader.
|
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.
|
ResponseCommand |
waitResponse()
Wait response with unlimit timeout
|
ResponseCommand |
waitResponse(long timeoutMillis)
Wait response with timeout.
|
public DefaultInvokeFuture(int invokeId,
InvokeCallbackListener callbackListener,
InvokeCallback callback,
byte protocol,
CommandFactory commandFactory)
invokeId - invoke idcallbackListener - callback listenercallback - callbackprotocol - protocol codecommandFactory - command factorypublic DefaultInvokeFuture(int invokeId,
InvokeCallbackListener callbackListener,
InvokeCallback callback,
byte protocol,
CommandFactory commandFactory,
InvokeContext invokeContext)
invokeId - invoke idcallbackListener - callback listenercallback - callbackprotocol - protocolcommandFactory - command factoryinvokeContext - invoke contextpublic ResponseCommand waitResponse(long timeoutMillis) throws InterruptedException
InvokeFuturewaitResponse in interface InvokeFuturetimeoutMillis - time out in millisecondInterruptedException - if interruptedpublic ResponseCommand waitResponse() throws InterruptedException
InvokeFuturewaitResponse in interface InvokeFutureInterruptedException - if interruptedpublic RemotingCommand createConnectionClosedResponse(InetSocketAddress responseHost)
InvokeFuturecreateConnectionClosedResponse in interface InvokeFutureresponseHost - target hostpublic void putResponse(RemotingCommand response)
InvokeFutureputResponse in interface InvokeFutureresponse - remoting commandInvokeFuture.putResponse(com.alipay.remoting.RemotingCommand)public boolean isDone()
InvokeFutureisDone in interface InvokeFutureInvokeFuture.isDone()public ClassLoader getAppClassLoader()
InvokeFuturegetAppClassLoader in interface InvokeFuturepublic int invokeId()
InvokeFutureinvokeId in interface InvokeFutureInvokeFuture.invokeId()public void executeInvokeCallback()
InvokeFutureexecuteInvokeCallback in interface InvokeFuturepublic InvokeCallback getInvokeCallback()
InvokeFuturegetInvokeCallback in interface InvokeFutureInvokeFuture.getInvokeCallback()public void addTimeout(io.netty.util.Timeout timeout)
InvokeFutureaddTimeout in interface InvokeFutureInvokeFuture.addTimeout(io.netty.util.Timeout)public void cancelTimeout()
InvokeFuturecancelTimeout in interface InvokeFutureInvokeFuture.cancelTimeout()public void setCause(Throwable cause)
InvokeFuturesetCause in interface InvokeFutureInvokeFuture.setCause(java.lang.Throwable)public Throwable getCause()
InvokeFuturegetCause in interface InvokeFutureInvokeFuture.getCause()public byte getProtocolCode()
InvokeFuturegetProtocolCode in interface InvokeFutureInvokeFuture.getProtocolCode()public void setInvokeContext(InvokeContext invokeContext)
InvokeFuturesetInvokeContext in interface InvokeFutureInvokeFuture.getInvokeContext()public InvokeContext getInvokeContext()
InvokeFuturegetInvokeContext in interface InvokeFutureInvokeFuture.setInvokeContext(InvokeContext)public void tryAsyncExecuteInvokeCallbackAbnormally()
InvokeFuturetryAsyncExecuteInvokeCallbackAbnormally in interface InvokeFutureInvokeFuture.tryAsyncExecuteInvokeCallbackAbnormally()Copyright © 2024. All rights reserved.