protected void Application_Start(object sender, EventArgs e) { ConfigUtility.setAzureRuntime(false); ConfigurationActions myConfigActions = new ConfigurationActions(); Application["masterHost"] = ServiceConfigHelper.MasterServiceWebHost.MasterHost; if (Settings.ORDER_PROCESSING_MODE == StockTraderUtility.OPS_INPROCESS) InitConfigInProcessOrderService.initConfigOrderProcessService(ConfigUtility.masterServiceWebHostSyncObject, false); ConfigUtility.writeConsoleMessage("\nWeb Application Global Application_Start: Web App New BSL Node Starting. Hello!\n", EventLogEntryType.Information, true, new Trade.BusinessServiceConfigurationSettings.Settings()); }
protected void Application_Start(object sender, EventArgs e) { ConfigUtility.setAzureRuntime(true); ConfigurationActions myConfigActions = new ConfigurationActions(); Application["masterHost"] = ServiceConfigHelper.MasterServiceWebHost.MasterHost; if (Settings.ORDER_PROCESSING_MODE == StockTraderUtility.OPS_INPROCESS) InitConfigInProcessOrderService.initConfigOrderProcessService(ConfigUtility.masterServiceWebHostSyncObject, false); ConfigUtility.writeConsoleMessage("\nWeb Role Application_Start: New Node ID: " + AzureUtility.getRoleInstanceID() + " Has Started Successfully and Initialized Its Configuration From the Configuration Database. Welcome to Windows Azure!\n", EventLogEntryType.Warning, true, new Trade.BusinessServiceConfigurationSettings.Settings()); }
/// <summary> /// Loads BSL config settings from its repository, performs init on in-process Business Services. /// </summary> public static void initConfigBusinessService(object lockobject, bool force) { lock (lockobject) { if (!force && initialized) return; initialized = true; ConnectionStringSettings connSettingOPS = System.Configuration.ConfigurationManager.ConnectionStrings["OPS_CONFIGDB_SQL_CONN_STRING"]; ConnectionStringSettings connSettingBSL = System.Configuration.ConfigurationManager.ConnectionStrings["BSL_CONFIGDB_SQL_CONN_STRING"]; StockTraderWebApplicationSettings.Settings.BSL_CONFIGDB_SQL_CONN_STRING = connSettingBSL.ConnectionString; StockTraderWebApplicationSettings.Settings.OPS_CONFIGDB_SQL_CONN_STRING = connSettingOPS.ConnectionString; Trade.BusinessServiceConfigurationSettings.Settings.CONFIGDB_SQL_CONN_STRING = StockTraderWebApplicationSettings.Settings.BSL_CONFIGDB_SQL_CONN_STRING; Trade.BusinessServiceConfigurationSettings.Settings BSLSettings = new Trade.BusinessServiceConfigurationSettings.Settings(); ServiceConfigHelper configHelper = new ServiceConfigHelper(BSLSettings); Trade.BusinessServiceHostConfigurationImplementation.ConfigurationActions BSLConfigActions = new Trade.BusinessServiceHostConfigurationImplementation.ConfigurationActions(); Trade.BusinessServiceConfigurationSettings.Settings.thisService = new Trade.BusinessServiceHostConfigurationImplementation.ConfigurationService(); Trade.BusinessServiceConfigurationSettings.Settings.thisServiceConfigActions = BSLConfigActions; configHelper.InitializeConfigFromDatabase(false, ref Trade.BusinessServiceConfigurationSettings.Settings.connectionPointList, ref Trade.BusinessServiceConfigurationSettings.Settings.connectedServices, ref Trade.BusinessServiceConfigurationSettings.Settings.connectedConfigServices, ref Trade.BusinessServiceConfigurationSettings.Settings.hostedServices, ref Trade.BusinessServiceConfigurationSettings.Settings.serviceHosts, Trade.BusinessServiceConfigurationSettings.Settings.CONFIGDB_SQL_CONN_STRING); BSLConfigActions.initBusinessService(BSLSettings); if (Trade.BusinessServiceConfigurationSettings.Settings.ORDER_PROCESSING_MODE == StockTraderUtility.OPS_INPROCESS) { Trade.OrderProcessorServiceConfigurationSettings.Settings.CONFIGDB_SQL_CONN_STRING = StockTraderWebApplicationSettings.Settings.OPS_CONFIGDB_SQL_CONN_STRING; string thelockobject = "0"; Trade.BusinessServiceHostConfigurationImplementation.InitConfigInProcessOrderService.initConfigOrderProcessService(thelockobject,false); } RemoteNotifications remoteNotify = new RemoteNotifications(new Trade.BusinessServiceConfigurationSettings.Settings()); remoteNotify.notifyRemoteClientsAndHosts(false, ConfigUtility.ADD_HOSTS); List<ConnectedServices> connectedServices = (List<ConnectedServices>)ConfigUtility.reflectGetField(BSLSettings, "connectedServices"); object BSLSettingsObject = (object)BSLSettings; if (ServiceConfigHelper.MasterServiceWebHost.MasterHost != null) { ServiceConfigHelper.initOnlineMethodsCS(connectedServices, ServiceConfigHelper.MasterServiceWebHost.MasterHost._connectedServiceContracts, ref BSLSettingsObject); } else if (ServiceConfigHelper.MasterServiceSelfHost.MasterHost != null) { ServiceConfigHelper.initOnlineMethodsCS(connectedServices, ServiceConfigHelper.MasterServiceSelfHost.MasterHost._connectedServiceContracts, ref BSLSettingsObject); } BSLConfigActions.InitCommunicationChannels(BSLSettings, null, ConfigUtility.INIT_ALL_CONNECTED_INSTANCES); } }