com.alipay.remoting.rpc.protocol
Class RpcRequestProcessor

java.lang.Object
  extended by com.alipay.remoting.AbstractRemotingProcessor<RpcRequestCommand>
      extended by com.alipay.remoting.rpc.protocol.RpcRequestProcessor
All Implemented Interfaces:
RemotingProcessor<RpcRequestCommand>

public class RpcRequestProcessor
extends AbstractRemotingProcessor<RpcRequestCommand>

Process Rpc request.


Constructor Summary
RpcRequestProcessor()
          Default constructor.
RpcRequestProcessor(CommandFactory commandFactory)
          Constructor.
RpcRequestProcessor(ExecutorService executor)
           
 
Method Summary
 void doProcess(RemotingContext ctx, RpcRequestCommand cmd)
          Do the process.
 void process(RemotingContext ctx, RpcRequestCommand cmd, ExecutorService defaultExecutor)
          Process the remoting command with its own executor or with the defaultExecutor if its own if null.
 void sendResponseIfNecessary(RemotingContext ctx, byte type, RemotingCommand response)
          Send response using remoting context if necessary.
 
Methods inherited from class com.alipay.remoting.AbstractRemotingProcessor
getCommandFactory, getExecutor, setCommandFactory, setExecutor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RpcRequestProcessor

public RpcRequestProcessor()
Default constructor.


RpcRequestProcessor

public RpcRequestProcessor(CommandFactory commandFactory)
Constructor.


RpcRequestProcessor

public RpcRequestProcessor(ExecutorService executor)
Parameters:
executor -
Method Detail

process

public void process(RemotingContext ctx,
                    RpcRequestCommand cmd,
                    ExecutorService defaultExecutor)
             throws Exception
Description copied from class: AbstractRemotingProcessor
Process the remoting command with its own executor or with the defaultExecutor if its own if null.

Specified by:
process in interface RemotingProcessor<RpcRequestCommand>
Overrides:
process in class AbstractRemotingProcessor<RpcRequestCommand>
Throws:
Exception
See Also:
AbstractRemotingProcessor.process(com.alipay.remoting.RemotingContext, com.alipay.remoting.RemotingCommand, java.util.concurrent.ExecutorService)

doProcess

public void doProcess(RemotingContext ctx,
                      RpcRequestCommand cmd)
               throws Exception
Description copied from class: AbstractRemotingProcessor
Do the process.

Specified by:
doProcess in class AbstractRemotingProcessor<RpcRequestCommand>
Throws:
Exception
See Also:
AbstractRemotingProcessor.doProcess(com.alipay.remoting.RemotingContext, com.alipay.remoting.RemotingCommand)

sendResponseIfNecessary

public void sendResponseIfNecessary(RemotingContext ctx,
                                    byte type,
                                    RemotingCommand response)
Send response using remoting context if necessary.
If request type is oneway, no need to send any response nor exception.

Parameters:
ctx -
response -


Copyright © 2018. All rights reserved.