Пример #1
0
        public virtual void testRegisterProcessor()
        {
            ProcessorManager    processorManager     = new ProcessorManager();
            CommandCode         cmd1                 = RpcCommandCode.RPC_REQUEST;
            CommandCode         cmd2                 = RpcCommandCode.RPC_REQUEST;
            RpcRequestProcessor rpcRequestProcessor1 = new RpcRequestProcessor();
            RpcRequestProcessor rpcRequestProcessor2 = new RpcRequestProcessor();

            processorManager.registerProcessor(cmd1, rpcRequestProcessor1);
            processorManager.registerProcessor(cmd2, rpcRequestProcessor2);
            Assert.Equal(processorManager.getProcessor(cmd1), rpcRequestProcessor2);
            Assert.Equal(processorManager.getProcessor(cmd2), rpcRequestProcessor2);
        }
Пример #2
0
 //JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
 //ORIGINAL LINE: @SuppressWarnings({ "rawtypes", "unchecked" }) private void process(RemotingContext ctx, Object msg)
 private void process(RemotingContext ctx, object msg)
 {
     try
     {
         //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
         //ORIGINAL LINE: final rpc.RpcCommand cmd = (rpc.RpcCommand) msg;
         RpcCommand cmd = (RpcCommand)msg;
         //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
         //ORIGINAL LINE: final RemotingProcessor processor = processorManager.getProcessor(cmd.getCmdCode());
         var processor = processorManager.getProcessor(cmd.CmdCode);
         processor.process(ctx, cmd, processorManager.DefaultExecutor);
     }
     //JAVA TO C# CONVERTER WARNING: 'final' catch parameters are not available in C#:
     //ORIGINAL LINE: catch (final Throwable t)
     catch (System.Exception t)
     {
         processException(ctx, msg, t);
     }
 }