Пример #1
0
        public void consume(Command command)
        {
            if (command.isComposite())
            {
                List<Command> commands = command.getCommands();
                foreach (Command newCommand in commands)
                {

                    int schemaId = (int)newCommand.GetSchemaId();
                    List<Core> list = null;
                    coreMap.TryGetValue(schemaId, out list);
                    if (list != null)
                    {
                        foreach (Core core in list)
                        {
                            core.consume(newCommand);
                        }
                    }

                }
            }
            if (command.isCoreCommand())
            {
                int schemaId = (int)command.GetSchemaId();
                List<Core> list = coreMap[schemaId];
                if (list != null)
                {
                    foreach (Core core in list)
                    {
                        core.consume(command);
                    }
                }
            }
        }
Пример #2
0
 public void consumeUdp(Command command)
 {
     command.setNetworkProtocolType(NetworkProtocolType.unicast);
     if (command.isComposite())
     {
         List<Command> commands = command.getCommands();
         foreach (Command newCommand in commands)
         {
             newCommand.setNetworkProtocolType(NetworkProtocolType.unicast);
         }
         command.Push(PlanckDBConstants.COMMANDS, PlanckDBConstants.COMMAND_LIST, commands);
     }
     command.setNetworkProtocolType(NetworkProtocolType.unicast);
     try
     {
         consume(command);
     }
     catch (Exception e)
     {
         log.error(e.Message, e);
     }
 }