com.alipay.remoting
Interface CommandFactory

All Known Implementing Classes:
RpcCommandFactory

public interface CommandFactory

Command factory


Method Summary
<T extends RemotingCommand>
T
createConnectionClosedResponse(InetSocketAddress address, String message)
           
<T extends RemotingCommand>
T
createExceptionResponse(int id, ResponseStatus status)
           
<T extends RemotingCommand>
T
createExceptionResponse(int id, String errMsg)
           
<T extends RemotingCommand>
T
createExceptionResponse(int id, Throwable t, String errMsg)
           
<T extends RemotingCommand>
T
createRequestCommand(Object requestObject)
          create a request command with request object
<T extends RemotingCommand>
T
createResponse(Object responseObject, RemotingCommand requestCmd)
          create a normal response with response object
<T extends RemotingCommand>
T
createSendFailedResponse(InetSocketAddress address, Throwable throwable)
           
<T extends RemotingCommand>
T
createTimeoutResponse(InetSocketAddress address)
           
 

Method Detail

createRequestCommand

<T extends RemotingCommand> T createRequestCommand(Object requestObject)
create a request command with request object

Type Parameters:
T -
Parameters:
requestObject - the request object included in request command
Returns:

createResponse

<T extends RemotingCommand> T createResponse(Object responseObject,
                                             RemotingCommand requestCmd)
create a normal response with response object

Type Parameters:
T -
Parameters:
responseObject -
requestCmd -
Returns:

createExceptionResponse

<T extends RemotingCommand> T createExceptionResponse(int id,
                                                      String errMsg)

createExceptionResponse

<T extends RemotingCommand> T createExceptionResponse(int id,
                                                      Throwable t,
                                                      String errMsg)

createExceptionResponse

<T extends RemotingCommand> T createExceptionResponse(int id,
                                                      ResponseStatus status)

createTimeoutResponse

<T extends RemotingCommand> T createTimeoutResponse(InetSocketAddress address)

createSendFailedResponse

<T extends RemotingCommand> T createSendFailedResponse(InetSocketAddress address,
                                                       Throwable throwable)

createConnectionClosedResponse

<T extends RemotingCommand> T createConnectionClosedResponse(InetSocketAddress address,
                                                             String message)


Copyright © 2018. All rights reserved.