Ejemplo n.º 1
0
        public void Start(IConfigSource config, IRegistryCore registry)
        {
            IConfig handlerConfig = config.Configs["Handlers"];
            if (handlerConfig.GetString("GridInfoInHandler", "") != Name)
                return;

            IHttpServer server = registry.RequestModuleInterface<ISimulationBase>().GetHttpServer((uint)handlerConfig.GetInt("GridInfoInHandlerPort"));
            GridInfoHandlers handlers = new GridInfoHandlers(config);

            server.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info",
                                                               handlers.RestGetGridInfoMethod));
            server.AddXmlRPCHandler("get_grid_info", handlers.XmlRpcGridInfoMethod);
        }
Ejemplo n.º 2
0
        public void Start(IConfigSource config, IRegistryCore registry)
        {
            IConfig handlerConfig = config.Configs["Handlers"];

            if (handlerConfig.GetString("GridInfoInHandler", "") != Name)
            {
                return;
            }

            IHttpServer      server   = registry.RequestModuleInterface <ISimulationBase>().GetHttpServer((uint)handlerConfig.GetInt("GridInfoInHandlerPort"));
            GridInfoHandlers handlers = new GridInfoHandlers(config);

            server.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info",
                                                          handlers.RestGetGridInfoMethod));
            server.AddXmlRPCHandler("get_grid_info", handlers.XmlRpcGridInfoMethod);
        }