private void AutoStartServiceHosts() { IServiceBusHostWorkerRoleExtension serviceHostExtension = Extensions.Find <IServiceBusHostWorkerRoleExtension>(); if (serviceHostExtension != null) { serviceHostExtension.StartAll(true); } }
/// <summary> /// Extends the Run phase that is called by Windows Azure runtime after the role instance has been initialized. /// </summary> protected override void OnRoleRun() { IServiceBusHostWorkerRoleExtension serviceHostExtension = Extensions.Find <IServiceBusHostWorkerRoleExtension>(); if (serviceHostExtension != null) { PersistenceService persistenceService = serviceHostExtension.FindServiceHost <PersistenceService>(); if (persistenceService != null) { persistenceService.PersistDataStreamCompleted += new OperationCompletedDelegate <PersistenceQueueItemInfo>(OnPersistDataStreamCompleted); } serviceHostExtension.StartAll(); } }
/// <summary> /// Extends the Run phase that is called by Windows Azure runtime after the role instance has been initialized. /// </summary> protected override void OnRoleRun() { Extensions.Demand <IServiceBusHostWorkerRoleExtension>(); Extensions.Demand <IScalableTransformServiceExtension>(); IServiceBusHostWorkerRoleExtension serviceHostExtension = Extensions.Find <IServiceBusHostWorkerRoleExtension>(); IScalableTransformServiceExtension transformServiceImpl = Extensions.Find <IScalableTransformServiceExtension>(); ScalableTransformService transformService = serviceHostExtension.FindServiceHost <ScalableTransformService>(); if (transformService != null) { transformService.OnPrepareTransform = transformServiceImpl.PrepareTransform; transformService.OnApplyTransform = transformServiceImpl.ApplyTransform; transformService.OnCompleteTransform = transformServiceImpl.CompleteTransform; } serviceHostExtension.StartAll(); }