Example #1
0
        } // end StageAsync()

        private void _DoStaging(IStageCallback stageCallback)
        {
            // Nothing to do except report that we're ready to run the command.
            // All timestamps should be UTC.
            UpdateStagingResult usr = new UpdateStagingResult(m_update, ResultCode.Succeeded, 0, DateTime.UtcNow);

            stageCallback.ReportStagingResult(usr);
        } // end _DoStaging()
Example #2
0
        } // end _DoScan()

        public async Task StageAsync(IStageCallback stageCallback)
        {
            try
            {
                await Task.Factory.StartNew(() => _DoStaging( stageCallback ), m_cancelToken);
            }
            catch (FabrikamException fe)
            {
                // Note that if an "update" fails to stage, it is reported through the
                // stageCallback.ReportStagingResult method. Only a more serious problem
                // representing a complete infrastructure failure should be reported by
                // throwing a ClusterUpdateException.
                throw new ClusterUpdateException(String.Format(CultureInfo.CurrentCulture,
                                                               "Staging node \"{0}\" failed: {1}",
                                                               m_machine,
                                                               fe.Message),
                                                 "StageFailed",
                                                 ErrorCategory.NotSpecified,
                                                 fe);
            }
        } // end StageAsync()
        } // end StageAsync()


        private void _DoStaging( IStageCallback stageCallback )
        {
            // Nothing to do except report that we're ready to run the command.
            // All timestamps should be UTC.
            UpdateStagingResult usr = new UpdateStagingResult( m_update, ResultCode.Succeeded, 0, DateTime.UtcNow );
            stageCallback.ReportStagingResult( usr );
        } // end _DoStaging()
        } // end _DoScan()


        public async Task StageAsync( IStageCallback stageCallback )
        {
            try
            {
                await Task.Factory.StartNew( () => _DoStaging( stageCallback ), m_cancelToken );
            }
            catch( FabrikamException fe )
            {
                // Note that if an "update" fails to stage, it is reported through the
                // stageCallback.ReportStagingResult method. Only a more serious problem
                // representing a complete infrastructure failure should be reported by
                // throwing a ClusterUpdateException.
                throw new ClusterUpdateException( String.Format( CultureInfo.CurrentCulture,
                                                                 "Staging node \"{0}\" failed: {1}",
                                                                 m_machine,
                                                                 fe.Message ),
                                                  "StageFailed",
                                                  ErrorCategory.NotSpecified,
                                                  fe );
            }
        } // end StageAsync()