Exemplo n.º 1
0
        private void AutoStartServiceHosts()
        {
            IServiceBusHostWorkerRoleExtension serviceHostExtension = Extensions.Find <IServiceBusHostWorkerRoleExtension>();

            if (serviceHostExtension != null)
            {
                serviceHostExtension.StartAll(true);
            }
        }
Exemplo n.º 2
0
        /// <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();
            }
        }
Exemplo n.º 3
0
        /// <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();
        }