예제 #1
0
            /// <summary>
            ///  この処理の実行を非同期的に開始します。
            /// </summary>
            /// <param name="context">実行に必要な文脈情報です。</param>
            /// <param name="arg">処理に必要な引数です。</param>
            /// <returns>戻り値を含むこの処理を表す非同期操作です。</returns>
            /// <exception cref="System.InvalidOperationException">
            ///  <see cref="ExapisSOP.IProcess.IsExecutable"/>が<see langword="false"/>の時に発生します。
            /// </exception>
            public async Task <object?> InvokeAsync(IContext context, object?arg)
            {
                if (!this.IsExecutable)
                {
                    throw new InvalidOperationException(
                              string.Format(Resources.CustomPipelineProcess_InvalidOperationException, this.GetType().FullName));
                }
                _logger?.Trace($"{this.NextProcess.GetType().FullName}: begin");
                object?result;

                try {
                    result = await this.NextProcess.InvokeAsync(context, arg);
                } catch (Exception e) {
                    _logger?.UnhandledException(e);
                    throw;
                }
                _logger?.Trace($"{this.NextProcess.GetType().FullName}: end");
                return(result);
            }