com.alipay.remoting.rpc.protocol
Class RpcCommandHandler

java.lang.Object
  extended by com.alipay.remoting.rpc.protocol.RpcCommandHandler
All Implemented Interfaces:
CommandHandler

@ChannelHandler.Sharable
public class RpcCommandHandler
extends Object
implements CommandHandler

Rpc command handler.


Constructor Summary
RpcCommandHandler(CommandFactory commandFactory)
          Constructor.
 
Method Summary
 ExecutorService getDefaultExecutor()
          Get default executor for the handler.
 void handleCommand(RemotingContext ctx, Object msg)
          Handle the command.
 void registerDefaultExecutor(ExecutorService executor)
          Register default executor for the handler.
 void registerProcessor(CommandCode cmd, RemotingProcessor processor)
          Register processor for command with specified code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RpcCommandHandler

public RpcCommandHandler(CommandFactory commandFactory)
Constructor. Initialize the processor manager and register processors.

Method Detail

handleCommand

public void handleCommand(RemotingContext ctx,
                          Object msg)
                   throws Exception
Description copied from interface: CommandHandler
Handle the command.

Specified by:
handleCommand in interface CommandHandler
Throws:
Exception
See Also:
CommandHandler.handleCommand(RemotingContext, Object)

registerProcessor

public void registerProcessor(CommandCode cmd,
                              RemotingProcessor processor)
Description copied from interface: CommandHandler
Register processor for command with specified code.

Specified by:
registerProcessor in interface CommandHandler
See Also:
CommandHandler.registerProcessor(com.alipay.remoting.CommandCode, RemotingProcessor)

registerDefaultExecutor

public void registerDefaultExecutor(ExecutorService executor)
Description copied from interface: CommandHandler
Register default executor for the handler.

Specified by:
registerDefaultExecutor in interface CommandHandler
See Also:
CommandHandler.registerDefaultExecutor(java.util.concurrent.ExecutorService)

getDefaultExecutor

public ExecutorService getDefaultExecutor()
Description copied from interface: CommandHandler
Get default executor for the handler.

Specified by:
getDefaultExecutor in interface CommandHandler
See Also:
CommandHandler.getDefaultExecutor()


Copyright © 2018. All rights reserved.