Example #1
0
        /// <summary>
        /// Constructor. Initialize the processor manager and register processors.
        /// </summary>
        public RpcCommandHandler(CommandFactory commandFactory)
        {
            this.commandFactory = commandFactory;
            processorManager    = new ProcessorManager();
            //process request
            processorManager.registerProcessor(RpcCommandCode.RPC_REQUEST, new RpcRequestProcessor(this.commandFactory));
            //process response
            processorManager.registerProcessor(RpcCommandCode.RPC_RESPONSE, new RpcResponseProcessor());

            processorManager.registerProcessor(CommonCommandCode.HEARTBEAT, new RpcHeartBeatProcessor());

            processorManager.registerDefaultProcessor(new AbstractRemotingProcessorAnonymousInnerClass(this));
        }