internal DispatchOperationRuntime(DispatchOperation operation, ImmutableDispatchRuntime parent)
        {
            if (operation == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("operation");
            }
            if (parent == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("parent");
            }
            if (operation.Invoker == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.RuntimeRequiresInvoker0));
            }

            _disposeParameters = ((operation.AutoDisposeParameters) && (!operation.HasNoDisposableParameters));
            _parent = parent;
            _inspectors = EmptyArray<IParameterInspector>.ToArray(operation.ParameterInspectors);
            _faultFormatter = operation.FaultFormatter;
            _deserializeRequest = operation.DeserializeRequest;
            _serializeReply = operation.SerializeReply;
            _formatter = operation.Formatter;
            _invoker = operation.Invoker;

            _isSessionOpenNotificationEnabled = operation.IsSessionOpenNotificationEnabled;
            _action = operation.Action;
            _name = operation.Name;
            _replyAction = operation.ReplyAction;
            _isOneWay = operation.IsOneWay;

            if (_formatter == null && (_deserializeRequest || _serializeReply))
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR.DispatchRuntimeRequiresFormatter0, _name)));
            }
        }
 public SecurityOperationInterceptor(OperationDescription operationDescription, IOperationInvoker invoker, bool showExceptionDetailToClient, bool needVerify, bool needToken, bool needRequestLog)
     : base(operationDescription, invoker, showExceptionDetailToClient)
 {
     this.needVerify = needVerify;
     this.needToken = needToken;
     this.needRequestLog = needRequestLog;
 }
        public LoginInvoker(IOperationInvoker invoker)
        {
            this.OperInvoker = invoker;

            IHibernateOper hibernateOper = HibernateFactory.GetInstance();
            empModFuncOper = new TbBaseOper<EmpModFunc>(hibernateOper, typeof(EmpModFunc));
        }
 public ProfilingOperationInvoker(DispatchOperation dispatchOperation, string outputPath)
 {
     _operation = dispatchOperation;
     _original = dispatchOperation.Invoker;
     IsSynchronous = _original.IsSynchronous;
     OutputPath = outputPath;
 }
Пример #5
0
 public CorsInvoker(IOperationInvoker invoker)
 {
     if (!invoker.IsSynchronous)
     {
         throw new NotSupportedException("This implementation only supports syncronous invokers.");
     }
     _originalInvoker = invoker;
 }
        public PowerInvoker(IOperationInvoker invoker, string funcName)
        {
            this.OperInvoker = invoker;
            this.FuncName = funcName;

            IHibernateOper hibernateOper = HibernateFactory.GetInstance();
            empModFuncOper = new TbBaseOper<EmpModFunc>(hibernateOper, typeof(EmpModFunc));
            empModOper = new TbBaseOper<EmpMod>(hibernateOper, typeof(EmpMod));
        }
Пример #7
0
 public CachingOperationInvoker(
     string operationName,
     IOperationInvoker previousInvoker,
     TimeSpan expirationTime,
     string regionName)
 {
     this.previousInvoker = previousInvoker;
     this.operationName = operationName;
     this.expirationTime = expirationTime;
     this.regionName = regionName;
 }
        public ServiceOperationInvoker(IOperationInvoker innerInvoker, bool completesInstance, bool canCreateInstance, bool contractCausesSave)
        {
            if (innerInvoker == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("innerInvoker");
            }

            this.innerInvoker = innerInvoker;
            this.completesInstance = completesInstance;
            this.canCreateInstance = canCreateInstance;
            this.contractCausesSave = contractCausesSave;
        }
 public OperationAuthenticationInvoker(
     IOperationInvoker invoker,
     IWebAuthenticationHandler handler,
     Type validatorType,
     bool requiresTransportLayerSecurity,
     string source)
 {
     _invoker = invoker.ThrowIfNull();
     _handler = handler.ThrowIfNull();
     _validatorType = validatorType;
     _requiresTransportLayerSecurity = requiresTransportLayerSecurity;
     _source = source;
 }
 // ────────────────────────── Constructors ──────────────────────────
 public OperationAuthenticationInvoker(
     IOperationInvoker invoker,
     IWebAuthenticationHandler handler,
     UserNamePasswordValidator validator,
     bool requiresTransportLayerSecurity,
     string source)
 {
     _invoker = invoker;
     _handler = handler;
     _validator = validator;
     _requiresTransportLayerSecurity = requiresTransportLayerSecurity;
     _source = source;
 }
        public ControlOperationInvoker(OperationDescription description, ServiceEndpoint endpoint,
            CorrelationKeyCalculator correlationKeyCalculator, IOperationInvoker innerInvoker, ServiceHostBase host)
        {
            Fx.Assert(host is WorkflowServiceHost, "ControlOperationInvoker must be used with a WorkflowServiceHost");

            this.host = (WorkflowServiceHost)host;
            this.instanceManager = this.host.DurableInstanceManager;
            this.operationName = description.Name;
            this.isOneWay = description.IsOneWay;
            this.endpoint = endpoint;
            this.innerInvoker = innerInvoker;
            this.keyCalculator = correlationKeyCalculator;
            this.persistTimeout = this.host.PersistTimeout;

            if (description.DeclaringContract == WorkflowControlEndpoint.WorkflowControlServiceContract ||
                description.DeclaringContract == WorkflowControlEndpoint.WorkflowControlServiceBaseContract)
            {
                //Mode1: This invoker belongs to IWorkflowInstanceManagement operation.
                this.isControlOperation = true;
                switch (this.operationName)
                {
                    case XD2.WorkflowInstanceManagementService.Cancel:
                    case XD2.WorkflowInstanceManagementService.TransactedCancel:
                    case XD2.WorkflowInstanceManagementService.Run:
                    case XD2.WorkflowInstanceManagementService.TransactedRun:
                    case XD2.WorkflowInstanceManagementService.Unsuspend:
                    case XD2.WorkflowInstanceManagementService.TransactedUnsuspend:
                        this.inputParameterCount = 1;
                        break;
                    case XD2.WorkflowInstanceManagementService.Abandon:
                    case XD2.WorkflowInstanceManagementService.Suspend:
                    case XD2.WorkflowInstanceManagementService.TransactedSuspend:
                    case XD2.WorkflowInstanceManagementService.Terminate:
                    case XD2.WorkflowInstanceManagementService.TransactedTerminate:
                    case XD2.WorkflowInstanceManagementService.Update:
                    case XD2.WorkflowInstanceManagementService.TransactedUpdate:
                        this.inputParameterCount = 2;
                        break;
                    default:
                        throw Fx.AssertAndThrow("Unreachable code");
                }
            }
            else if (endpoint is WorkflowHostingEndpoint)
            {
                this.CanCreateInstance = true;
            }
            else
            {
                this.bufferedReceiveManager = this.host.Extensions.Find<BufferedReceiveManager>();
            }
        }
        public ControlOperationInvoker(OperationDescription description, ServiceEndpoint endpoint, CorrelationKeyCalculator correlationKeyCalculator, IOperationInvoker innerInvoker, ServiceHostBase host)
        {
            this.host = (WorkflowServiceHost) host;
            this.instanceManager = this.host.DurableInstanceManager;
            this.operationName = description.Name;
            this.isOneWay = description.IsOneWay;
            this.endpoint = endpoint;
            this.innerInvoker = innerInvoker;
            this.keyCalculator = correlationKeyCalculator;
            this.persistTimeout = this.host.PersistTimeout;
            if (description.DeclaringContract == WorkflowControlEndpoint.WorkflowControlServiceContract)
            {
                this.isControlOperation = true;
                switch (this.operationName)
                {
                    case "Cancel":
                    case "TransactedCancel":
                    case "Run":
                    case "TransactedRun":
                    case "Unsuspend":
                    case "TransactedUnsuspend":
                        this.inputParameterCount = 1;
                        return;

                    case "Abandon":
                    case "Suspend":
                    case "TransactedSuspend":
                    case "Terminate":
                    case "TransactedTerminate":
                        this.inputParameterCount = 2;
                        return;
                }
                throw Fx.AssertAndThrow("Unreachable code");
            }
            if (endpoint is WorkflowHostingEndpoint)
            {
                this.CanCreateInstance = true;
            }
            else
            {
                this.bufferedReceiveManager = this.host.Extensions.Find<System.ServiceModel.Activities.Dispatcher.BufferedReceiveManager>();
            }
        }
 public TypeCastOperationInvoker(IOperationInvoker invoker)
 {
     _invoker = invoker;
 }
        internal DispatchOperationRuntime(DispatchOperation operation, ImmutableDispatchRuntime parent)
        {
            if (operation == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("operation");
            }
            if (parent == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("parent");
            }
            if (operation.Invoker == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.RuntimeRequiresInvoker0)));
            }

            this.disposeParameters = ((operation.AutoDisposeParameters) && (!operation.HasNoDisposableParameters));
            this.parent = parent;
            this.callContextInitializers = EmptyArray<ICallContextInitializer>.ToArray(operation.CallContextInitializers);
            this.inspectors = EmptyArray<IParameterInspector>.ToArray(operation.ParameterInspectors);
            this.faultFormatter = operation.FaultFormatter;
            this.impersonation = operation.Impersonation;
            this.deserializeRequest = operation.DeserializeRequest;
            this.serializeReply = operation.SerializeReply;
            this.formatter = operation.Formatter;
            this.invoker = operation.Invoker;

            try
            {
                this.isSynchronous = operation.Invoker.IsSynchronous;
            }
            catch (Exception e)
            {
                if (Fx.IsFatal(e))
                {
                    throw;
                }
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperCallback(e);
            }
            this.isTerminating = operation.IsTerminating;
            this.isSessionOpenNotificationEnabled = operation.IsSessionOpenNotificationEnabled;
            this.action = operation.Action;
            this.name = operation.Name;
            this.releaseInstanceAfterCall = operation.ReleaseInstanceAfterCall;
            this.releaseInstanceBeforeCall = operation.ReleaseInstanceBeforeCall;
            this.replyAction = operation.ReplyAction;
            this.isOneWay = operation.IsOneWay;
            this.transactionAutoComplete = operation.TransactionAutoComplete;
            this.transactionRequired = operation.TransactionRequired;
            this.receiveContextAcknowledgementMode = operation.ReceiveContextAcknowledgementMode;
            this.bufferedReceiveEnabled = operation.BufferedReceiveEnabled;
            this.isInsideTransactedReceiveScope = operation.IsInsideTransactedReceiveScope;

            if (this.formatter == null && (deserializeRequest || serializeReply))
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.DispatchRuntimeRequiresFormatter0, this.name)));
            }

            if ((operation.Parent.InstanceProvider == null) && (operation.Parent.Type != null))
            {
                SyncMethodInvoker sync = this.invoker as SyncMethodInvoker;
                if (sync != null)
                {
                    this.ValidateInstanceType(operation.Parent.Type, sync.Method);
                }

                AsyncMethodInvoker async = this.invoker as AsyncMethodInvoker;
                if (async != null)
                {
                    this.ValidateInstanceType(operation.Parent.Type, async.BeginMethod);
                    this.ValidateInstanceType(operation.Parent.Type, async.EndMethod);
                }

                TaskMethodInvoker task = this.invoker as TaskMethodInvoker;
                if (task != null)
                {
                    this.ValidateInstanceType(operation.Parent.Type, task.TaskMethod);
                }
            }
        }
 public InvokerBase(IOperationInvoker oldInvoker)
 {
     m_OldInvoker = oldInvoker;
 }
Пример #16
0
 public OperationInvoker(IOperationInvoker innerOperationInvoker)
 {
     this.innerOperationInvoker = innerOperationInvoker;
 }
Пример #17
0
        internal static Task <(object result, object[] outputs)> InvokeAsync(this IOperationInvoker operationInvoker, object instance, object[] inputs)
        {
            var helper = new OperationInvokerAsyncHelper(operationInvoker, instance);

            return(helper.InvokeAsync(inputs));
        }
Пример #18
0
 public ParameterTracerInvoker(IOperationInvoker oldInvoker, string operationName)
     : base(oldInvoker)
 {
     this.operationName = operationName;
 }
Пример #19
0
        public void ApplyDispatchBehavior(OperationDescription operationDescription, DispatchOperation dispatchOperation)
        {
            IOperationInvoker baseInvoker = dispatchOperation.Invoker;

            dispatchOperation.Invoker = new EGOperationInvoker(baseInvoker, operationDescription);
        }
Пример #20
0
 public CustomOperaionInvoker(MethodInfo targetmethod, IOperationInvoker invoker, OperationDescription operationDescription)
 {
     this.invoker = invoker;
     opsDesc      = operationDescription;
 }
Пример #21
0
        public void ApplyDispatchBehavior(OperationDescription operationDescription, System.ServiceModel.Dispatcher.DispatchOperation dispatchOperation)
        {
            IOperationInvoker invoker = dispatchOperation.Invoker;

            dispatchOperation.Invoker = new WCFSerialCachingInvoker(invoker);
        }
Пример #22
0
    public LoggingOperationInvoker(IOperationInvoker baseInvoker, DispatchOperation operation)
    {
        IOperationInvoker _baseInvoker = baseInvoker;

        _operationName = operation.Name;
    }
Пример #23
0
 public OperationInvokerWrapper(IOperationInvoker invoker, CcpServiceHostWrapper hostWrapper)
 {
     this.innerInvoker = invoker;
     this.hostWrapper  = hostWrapper;
 }
Пример #24
0
 public ZipCodeCacher(int index, IOperationInvoker innerInvoker)
 {
     this.index        = index;
     this.innerInvoker = innerInvoker;
 }
 protected override GenericInvoker CreateInvoker(IOperationInvoker oldInvoker)
 {
     return new SecurityCallStackInterceptor(oldInvoker);
 }
 public SecurityCallStackInterceptor(IOperationInvoker oldInvoker) : base(oldInvoker)
 {
 }
Пример #27
0
 public WcfTransactionInvoker(IOperationInvoker inner)
 {
     this._inner = inner;
 }
 protected override GenericInvoker CreateInvoker(IOperationInvoker oldInvoker)
 {
     return(new SecurityCallStackInterceptor(oldInvoker));
 }
 protected abstract GenericInvoker CreateInvoker(IOperationInvoker oldInvoker);
Пример #30
0
 /// <summary>
 /// Initializes a new instance of the <see cref="STAInvoker"/> class.
 /// </summary>
 /// <param name="operationInvoker">The operation invoker.</param>
 public STAInvoker(IOperationInvoker operationInvoker)
 {
     InnerOperationInvoker = operationInvoker;
 }
        internal DispatchOperationRuntime(DispatchOperation operation, ImmutableDispatchRuntime parent)
        {
            if (operation == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("operation");
            }
            if (parent == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("parent");
            }
            if (operation.Invoker == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.RuntimeRequiresInvoker0)));
            }

            this.disposeParameters       = ((operation.AutoDisposeParameters) && (!operation.HasNoDisposableParameters));
            this.parent                  = parent;
            this.callContextInitializers = EmptyArray <ICallContextInitializer> .ToArray(operation.CallContextInitializers);

            this.inspectors = EmptyArray <IParameterInspector> .ToArray(operation.ParameterInspectors);

            this.faultFormatter     = operation.FaultFormatter;
            this.impersonation      = operation.Impersonation;
            this.deserializeRequest = operation.DeserializeRequest;
            this.serializeReply     = operation.SerializeReply;
            this.formatter          = operation.Formatter;
            this.invoker            = operation.Invoker;

            try
            {
                this.isSynchronous = operation.Invoker.IsSynchronous;
            }
            catch (Exception e)
            {
                if (Fx.IsFatal(e))
                {
                    throw;
                }
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperCallback(e);
            }
            this.isTerminating = operation.IsTerminating;
            this.isSessionOpenNotificationEnabled = operation.IsSessionOpenNotificationEnabled;
            this.action = operation.Action;
            this.name   = operation.Name;
            this.releaseInstanceAfterCall  = operation.ReleaseInstanceAfterCall;
            this.releaseInstanceBeforeCall = operation.ReleaseInstanceBeforeCall;
            this.replyAction                       = operation.ReplyAction;
            this.isOneWay                          = operation.IsOneWay;
            this.transactionAutoComplete           = operation.TransactionAutoComplete;
            this.transactionRequired               = operation.TransactionRequired;
            this.receiveContextAcknowledgementMode = operation.ReceiveContextAcknowledgementMode;
            this.bufferedReceiveEnabled            = operation.BufferedReceiveEnabled;
            this.isInsideTransactedReceiveScope    = operation.IsInsideTransactedReceiveScope;

            if (this.formatter == null && (deserializeRequest || serializeReply))
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.DispatchRuntimeRequiresFormatter0, this.name)));
            }

            if ((operation.Parent.InstanceProvider == null) && (operation.Parent.Type != null))
            {
                SyncMethodInvoker sync = this.invoker as SyncMethodInvoker;
                if (sync != null)
                {
                    this.ValidateInstanceType(operation.Parent.Type, sync.Method);
                }

                AsyncMethodInvoker async = this.invoker as AsyncMethodInvoker;
                if (async != null)
                {
                    this.ValidateInstanceType(operation.Parent.Type, async.BeginMethod);
                    this.ValidateInstanceType(operation.Parent.Type, async.EndMethod);
                }

                TaskMethodInvoker task = this.invoker as TaskMethodInvoker;
                if (task != null)
                {
                    this.ValidateInstanceType(operation.Parent.Type, task.TaskMethod);
                }
            }
        }
 public StudentController(IQueryable <Student> students, IOperationInvoker operationInvoker)
 {
     this.students          = students;
     this._operationInvoker = operationInvoker;
 }
 protected abstract InvokerBase CreateInvoker(IOperationInvoker oldInvoker, OperationDescription operationDescription, DispatchOperation dispatchOperation);
 public TimingOperationInvoker(IOperationInvoker previousInvoker)
 {
     _previousInvoker = previousInvoker;
 }
Пример #35
0
 public EGOperationInvoker(IOperationInvoker baseInvoker, OperationDescription operationDescription)
 {
     this.invoker = baseInvoker;
     this.operationDescription = operationDescription;
 }
Пример #36
0
 public AuthorizeOperationInvoker(IOperationInvoker innerOperationInvoker, string operationName, string roleNames)
 {
     _innerOperationInvoker = innerOperationInvoker;
     _operationName         = operationName;
     _roleNames             = roleNames.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
 }
 protected override InvokerBase CreateInvoker(IOperationInvoker oldInvoker, OperationDescription operationDescription, DispatchOperation dispatchOperation)
 {
     return(new ResponseExceptionInvoker(oldInvoker, operationDescription));
 }
Пример #38
0
 /// <summary>
 /// Initializes a new instance of the <see cref="STAInvoker"/> class.
 /// </summary>
 /// <param name="operationInvoker">The operation invoker.</param>
 public STAInvoker(IOperationInvoker operationInvoker)
 {
     InnerOperationInvoker = operationInvoker;
 }
Пример #39
0
 public NHibernateTransaction(IOperationInvoker innerOperationInvoker)
 {
     this.innerOperationInvoker = innerOperationInvoker;
 }
 /// <summary>
 ///   Implements a modification or extension of the service across an operation.
 /// </summary>
 /// <param name = "operationDescription">The operation being examined. Use for examination only. If the operation description is modified, the results are undefined.</param>
 /// <param name = "dispatchOperation">The run-time object that exposes customization properties for the operation described by <paramref name = "operationDescription" />.</param>
 public void ApplyDispatchBehavior(OperationDescription operationDescription, DispatchOperation dispatchOperation)
 {
     _innerOperationInvoker = dispatchOperation.Invoker;
     dispatchOperation.Invoker = this;
 }
 public TypeCastOperationInvoker(IOperationInvoker invoker, MethodInfo info)
     : this(invoker)
 {
     this.info = info;
 }
 internal CacheExtension(IOperationInvoker invoker)
 {
     innerInvoker = invoker;
     provider     = CacheProviderFactory.CreateProvider("RESTCacheProvider");
 }
 public SecurityCallStackInterceptor(IOperationInvoker oldInvoker)
     : base(oldInvoker)
 {
 }
Пример #44
0
 protected override GenericInvoker CreateInvoker(IOperationInvoker oldInvoker)
 {
     return(new AuditInterceptor(oldInvoker));
 }
Пример #45
0
        public GenericInvoker(IOperationInvoker oldInvoker)
        {
            Debug.Assert(oldInvoker != null);

             m_OldInvoker = oldInvoker;
        }
        //- $InnerOperationInvoker -//

        //+
        //- @Ctor -//
        public BenchmarkOperationInvoker(IOperationInvoker operationInvoker)
        {
            InnerOperationInvoker = operationInvoker;
        }
        /// <summary>
        /// Intitializes a new instance of the <see cref="RequestHandlerDecorator" /> class.
        /// </summary>
		public RequestHandlerDecorator(IOperationInvoker innerInvoker)
			: base(innerInvoker)
		{
		}
Пример #48
0
 public ErrorHandlingInvoker(IOperationInvoker baseInvoker)
 {
     // Store the original default invoker
     _baseInvoker = baseInvoker;
 }
 public CustomOperationInvoker(IOperationInvoker innerInvoker)
 {
     _innerInvoker = innerInvoker;
 }
Пример #50
0
 public ESBMessageOperationInvoker(IOperationInvoker invoker, IExceptionHandle exceptionHandler)
 {
     m_Core             = invoker;
     m_ExceptionHandler = exceptionHandler;
 }
Пример #51
0
 public CheckClaimInvoker(IOperationInvoker invoker, CheckClaim.CheckItem[] checkitems)
 {
     this._invoker = invoker;
     this._checks = checkitems;
 }
Пример #52
0
 protected OperationInvoker CreateInvoker(IOperationInvoker oldInvoker)
 {
     return(new OperationInvoker(oldInvoker));
 }
Пример #53
0
 public OperationInvoker(IOperationInvoker innerOperationInvoker)
 {
     this.innerOperationInvoker = innerOperationInvoker;
 }
 protected ExtOperationInvoker CreateInvoker(IOperationInvoker oldInvoker)
 {
     return(new ExtOperationInvoker(oldInvoker, m_FunctionDescription, m_InteType, m_IgnoreType));
 }
            public ServiceOperationAsyncResult(IOperationInvoker innerInvoker, WorkflowServiceInstance durableInstance,
                object[] inputs, OperationContext operationContext, Transaction currentTransaction, IInvokeReceivedNotification notification,
                AsyncCallback callback, object state)
                : base(callback, state)
            {
                this.durableInstance = durableInstance;
                this.operationContext = operationContext;
                this.inputs = inputs;
                this.innerInvoker = innerInvoker;
                this.currentTransaction = currentTransaction;
                this.notification = notification;

                if (innerInvoker == null)
                {
                    //Mode2: Derived invoker should have handled this call.
                    throw Fx.AssertAndThrow("Cannot reach this path without innerInvoker");
                }

                if (this.innerInvoker.IsSynchronous)
                {
                    TransactionScope scope = TransactionHelper.CreateTransactionScope(this.currentTransaction);
                    try
                    {
                        using (new OperationContextScopeHelper(this.operationContext))
                        {
                            IManualConcurrencyOperationInvoker manualInvoker = this.innerInvoker as IManualConcurrencyOperationInvoker;
                            if (manualInvoker != null)
                            {
                                this.returnValue = manualInvoker.Invoke(this.durableInstance, this.inputs, this.notification, out this.outputs);
                            }
                            else
                            {
                                this.returnValue = this.innerInvoker.Invoke(this.durableInstance, this.inputs, out this.outputs);
                            }
                        }
                    }
                    finally
                    {
                        TransactionHelper.CompleteTransactionScope(ref scope);
                    }
                    this.Complete(true);
                }
                else
                {
                    IAsyncResult result;
                    using (PrepareTransactionalCall(this.currentTransaction))
                    {
                        using (new OperationContextScopeHelper(this.operationContext))
                        {
                            IManualConcurrencyOperationInvoker manualInvoker = this.innerInvoker as IManualConcurrencyOperationInvoker;
                            if (manualInvoker != null)
                            {
                                result = manualInvoker.InvokeBegin(this.durableInstance, this.inputs, this.notification, this.PrepareAsyncCompletion(handleEndInvoke), this);
                            }
                            else
                            {
                                result = this.innerInvoker.InvokeBegin(this.durableInstance, this.inputs, this.PrepareAsyncCompletion(handleEndInvoke), this);
                            }
                        }
                    }
                    if (SyncContinue(result))
                    {
                        this.Complete(true);
                    }
                }
            }
        public void ApplyDispatchBehavior(OperationDescription operationDescription, DispatchOperation dispatchOperation)
        {
            IOperationInvoker oldInvoker = dispatchOperation.Invoker;

            dispatchOperation.Invoker = CreateInvoker(oldInvoker);
        }
 /// <summary>
 /// Intitializes a new instance of the <see cref="TransactionalDecorator" /> class.
 /// </summary>
 public TransactionalDecorator(IOperationInvoker innerInvoker)
     : base(innerInvoker)
 {
 }
Пример #58
0
 public Transaction(IOperationInvoker operationInvoker, TransactionState state)
 {
     this.state            = state;
     this.operationInvoker = operationInvoker;
 }
 public CustomOperationInvoker(IOperationInvoker innerInvoker)
 {
     _innerInvoker = innerInvoker;
 }
Пример #60
0
 protected override OperationInterceptor CreateInvoker(OperationDescription operationDescription, IOperationInvoker invoker)
 {
     return(new SecurityOperationInterceptor(operationDescription, invoker, this.ShowExceptionDetailToClient, this.NeedVerifyHeader, this.NeedTokenHeader, this.NeedRequestLog));
 }