com.alipay.remoting.rpc
Class RpcCommandFactory

java.lang.Object
  extended by com.alipay.remoting.rpc.RpcCommandFactory
All Implemented Interfaces:
CommandFactory

public class RpcCommandFactory
extends Object
implements CommandFactory

command factory for rpc protocol


Constructor Summary
RpcCommandFactory()
           
 
Method Summary
 RemotingCommand createConnectionClosedResponse(InetSocketAddress address, String message)
           
 RpcResponseCommand createExceptionResponse(int id, ResponseStatus status)
           
 RpcResponseCommand createExceptionResponse(int id, String errMsg)
           
 RpcResponseCommand createExceptionResponse(int id, Throwable t, String errMsg)
           
 RpcRequestCommand createRequestCommand(Object requestObject)
          create a request command with request object
 RpcResponseCommand createResponse(Object responseObject, RemotingCommand requestCmd)
          create a normal response with response object
 RemotingCommand createSendFailedResponse(InetSocketAddress address, Throwable throwable)
           
 ResponseCommand createTimeoutResponse(InetSocketAddress address)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RpcCommandFactory

public RpcCommandFactory()
Method Detail

createRequestCommand

public RpcRequestCommand createRequestCommand(Object requestObject)
Description copied from interface: CommandFactory
create a request command with request object

Specified by:
createRequestCommand in interface CommandFactory
Parameters:
requestObject - the request object included in request command
Returns:

createResponse

public RpcResponseCommand createResponse(Object responseObject,
                                         RemotingCommand requestCmd)
Description copied from interface: CommandFactory
create a normal response with response object

Specified by:
createResponse in interface CommandFactory
Returns:

createExceptionResponse

public RpcResponseCommand createExceptionResponse(int id,
                                                  String errMsg)
Specified by:
createExceptionResponse in interface CommandFactory

createExceptionResponse

public RpcResponseCommand createExceptionResponse(int id,
                                                  Throwable t,
                                                  String errMsg)
Specified by:
createExceptionResponse in interface CommandFactory

createExceptionResponse

public RpcResponseCommand createExceptionResponse(int id,
                                                  ResponseStatus status)
Specified by:
createExceptionResponse in interface CommandFactory

createTimeoutResponse

public ResponseCommand createTimeoutResponse(InetSocketAddress address)
Specified by:
createTimeoutResponse in interface CommandFactory

createSendFailedResponse

public RemotingCommand createSendFailedResponse(InetSocketAddress address,
                                                Throwable throwable)
Specified by:
createSendFailedResponse in interface CommandFactory

createConnectionClosedResponse

public RemotingCommand createConnectionClosedResponse(InetSocketAddress address,
                                                      String message)
Specified by:
createConnectionClosedResponse in interface CommandFactory


Copyright © 2018. All rights reserved.