当前位置: 首页>>代码示例>>C#>>正文


C# ISinglePhaseNotification类代码示例

本文整理汇总了C#中ISinglePhaseNotification的典型用法代码示例。如果您正苦于以下问题:C# ISinglePhaseNotification类的具体用法?C# ISinglePhaseNotification怎么用?C# ISinglePhaseNotification使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ISinglePhaseNotification类属于命名空间,在下文中一共展示了ISinglePhaseNotification类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InternalEnlistment

 internal InternalEnlistment(System.Transactions.Enlistment enlistment, InternalTransaction transaction, IEnlistmentNotification twoPhaseNotifications, ISinglePhaseNotification singlePhaseNotifications, System.Transactions.Transaction atomicTransaction)
 {
     this.enlistment = enlistment;
     this.transaction = transaction;
     this.twoPhaseNotifications = twoPhaseNotifications;
     this.singlePhaseNotifications = singlePhaseNotifications;
     this.atomicTransaction = atomicTransaction;
     this.enlistmentId = transaction.enlistmentCount++;
     this.traceIdentifier = EnlistmentTraceIdentifier.Empty;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:10,代码来源:InternalEnlistment.cs

示例2: Enlistment

 internal Enlistment(InternalTransaction transaction, IEnlistmentNotification twoPhaseNotifications, ISinglePhaseNotification singlePhaseNotifications, Transaction atomicTransaction, EnlistmentOptions enlistmentOptions)
 {
     if ((enlistmentOptions & EnlistmentOptions.EnlistDuringPrepareRequired) != EnlistmentOptions.None)
     {
         this.internalEnlistment = new System.Transactions.InternalEnlistment(this, transaction, twoPhaseNotifications, singlePhaseNotifications, atomicTransaction);
     }
     else
     {
         this.internalEnlistment = new Phase1VolatileEnlistment(this, transaction, twoPhaseNotifications, singlePhaseNotifications, atomicTransaction);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:11,代码来源:Enlistment.cs

示例3: EnlistDurable

 internal override Enlistment EnlistDurable(InternalTransaction tx, Guid resourceManagerIdentifier, ISinglePhaseNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
 {
     if ((tx.durableEnlistment != null) || ((enlistmentOptions & EnlistmentOptions.EnlistDuringPrepareRequired) != EnlistmentOptions.None))
     {
         tx.promoteState.EnterState(tx);
         return tx.State.EnlistDurable(tx, resourceManagerIdentifier, enlistmentNotification, enlistmentOptions, atomicTransaction);
     }
     Enlistment enlistment = new Enlistment(resourceManagerIdentifier, tx, enlistmentNotification, enlistmentNotification, atomicTransaction);
     tx.durableEnlistment = enlistment.InternalEnlistment;
     DurableEnlistmentState._DurableEnlistmentActive.EnterState(tx.durableEnlistment);
     if (DiagnosticTrace.Information)
     {
         EnlistmentTraceRecord.Trace(System.Transactions.SR.GetString("TraceSourceLtm"), tx.durableEnlistment.EnlistmentTraceId, EnlistmentType.Durable, EnlistmentOptions.None);
     }
     return enlistment;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:16,代码来源:EnlistableStates.cs

示例4: Enlistment

 internal Enlistment(
     Guid resourceManagerIdentifier,
     InternalTransaction transaction,
     IEnlistmentNotification twoPhaseNotifications,
     ISinglePhaseNotification singlePhaseNotifications,
     Transaction atomicTransaction)
 {
     _internalEnlistment = new DurableInternalEnlistment(
         this,
         resourceManagerIdentifier,
         transaction,
         twoPhaseNotifications,
         singlePhaseNotifications,
         atomicTransaction
         );
 }
开发者ID:dotnet,项目名称:corefx,代码行数:16,代码来源:Enlistment.cs

示例5: EnlistVolatile

 internal override Enlistment EnlistVolatile(InternalTransaction tx, ISinglePhaseNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
 {
     Enlistment enlistment = new Enlistment(tx, enlistmentNotification, enlistmentNotification, atomicTransaction, enlistmentOptions);
     if ((enlistmentOptions & EnlistmentOptions.EnlistDuringPrepareRequired) != EnlistmentOptions.None)
     {
         base.AddVolatileEnlistment(ref tx.phase0Volatiles, enlistment);
     }
     else
     {
         base.AddVolatileEnlistment(ref tx.phase1Volatiles, enlistment);
     }
     if (DiagnosticTrace.Information)
     {
         EnlistmentTraceRecord.Trace(System.Transactions.SR.GetString("TraceSourceLtm"), enlistment.InternalEnlistment.EnlistmentTraceId, EnlistmentType.Volatile, enlistmentOptions);
     }
     return enlistment;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:17,代码来源:TransactionStatePhase0.cs

示例6: EnlistDurable

        // Forward request to the state machine to take the appropriate action.
        //
        public Enlistment EnlistDurable(
            Guid resourceManagerIdentifier,
            ISinglePhaseNotification singlePhaseNotification,
            EnlistmentOptions enlistmentOptions)
        {
            if (DiagnosticTrace.Verbose)
            {
                MethodEnteredTraceRecord.Trace(SR.TraceSourceLtm, "Transaction.EnlistDurable( ISinglePhaseNotification )");
            }

            if (Disposed)
            {
                throw new ObjectDisposedException(nameof(Transaction));
            }

            if (resourceManagerIdentifier == Guid.Empty)
            {
                throw new ArgumentException(SR.BadResourceManagerId, nameof(resourceManagerIdentifier));
            }

            if (singlePhaseNotification == null)
            {
                throw new ArgumentNullException(nameof(singlePhaseNotification));
            }

            if (enlistmentOptions != EnlistmentOptions.None && enlistmentOptions != EnlistmentOptions.EnlistDuringPrepareRequired)
            {
                throw new ArgumentOutOfRangeException(nameof(enlistmentOptions));
            }

            if (_complete)
            {
                throw TransactionException.CreateTransactionCompletedException(SR.TraceSourceLtm, DistributedTxId);
            }

            lock (_internalTransaction)
            {
                Enlistment enlistment = _internalTransaction.State.EnlistDurable(_internalTransaction,
                    resourceManagerIdentifier, singlePhaseNotification, enlistmentOptions, this);

                if (DiagnosticTrace.Verbose)
                {
                    MethodExitedTraceRecord.Trace(SR.TraceSourceLtm, "Transaction.EnlistDurable( ISinglePhaseNotification )");
                }
                return enlistment;
            }
        }
开发者ID:geoffkizer,项目名称:corefx,代码行数:49,代码来源:Transaction.cs

示例7: PromoteAndEnlistDurable

        public Enlistment PromoteAndEnlistDurable(Guid resourceManagerIdentifier,
                                                  IPromotableSinglePhaseNotification promotableNotification,
                                                  ISinglePhaseNotification enlistmentNotification,
                                                  EnlistmentOptions enlistmentOptions)
        {
            if (DiagnosticTrace.Verbose)
            {
                MethodEnteredTraceRecord.Trace(SR.GetString(SR.TraceSourceOletx),
                    "Transaction.PromoteAndEnlistDurable"
                    );
            }

            if (Disposed)
            {
                throw new ObjectDisposedException("Transaction");
            }

            if (resourceManagerIdentifier == Guid.Empty)
            {
                throw new ArgumentException(SR.GetString(SR.BadResourceManagerId), "resourceManagerIdentifier");
            }

            if (promotableNotification == null)
            {
                throw new ArgumentNullException("promotableNotification");
            }

            if (enlistmentNotification == null)
            {
                throw new ArgumentNullException("enlistmentNotification");
            }

            if (enlistmentOptions != EnlistmentOptions.None && enlistmentOptions != EnlistmentOptions.EnlistDuringPrepareRequired)
            {
                throw new ArgumentOutOfRangeException("enlistmentOptions");
            }

            if (this.complete)
            {
                throw TransactionException.CreateTransactionCompletedException(SR.GetString(SR.TraceSourceLtm));
            }

            lock (this.internalTransaction)
            {
                Enlistment enlistment = this.internalTransaction.State.PromoteAndEnlistDurable(this.internalTransaction,
                    resourceManagerIdentifier, promotableNotification, enlistmentNotification, enlistmentOptions, this);

                if (DiagnosticTrace.Verbose)
                {
                    MethodExitedTraceRecord.Trace(SR.GetString(SR.TraceSourceOletx),
                        "Transaction.PromoteAndEnlistDurable"
                        );
                }
                return enlistment;
            }
        }
开发者ID:salim18,项目名称:DemoProject2,代码行数:56,代码来源:Transaction.cs

示例8: EnlistDurable

		public Enlistment EnlistDurable (Guid manager,
			ISinglePhaseNotification notification,
			EnlistmentOptions options)
		{
			if (durables.Count == 1)
				throw new NotImplementedException ("Only LTM supported. Cannot have more than 1 durable resource per transaction.");

			EnsureIncompleteCurrentScope ();

			if (options != EnlistmentOptions.None)
				throw new NotImplementedException ("Implement me");

			durables.Add (notification);

			/* FIXME: Enlistment ?? */
			return new Enlistment ();
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:17,代码来源:Transaction.cs

示例9: EnlistDurable

 internal override Enlistment EnlistDurable(InternalTransaction tx, Guid resourceManagerIdentifier, ISinglePhaseNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
 {
     throw new TransactionException(System.Transactions.SR.GetString("TooLate"));
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:4,代码来源:TransactionStatePromotedPhase1.cs

示例10: EnlistVolatile

		public Enlistment EnlistVolatile (
			ISinglePhaseNotification notification,
			EnlistmentOptions options)
		{
			/* FIXME: Anything extra reqd for this? */
			return EnlistVolatileInternal (notification, options);
		}
开发者ID:Profit0004,项目名称:mono,代码行数:7,代码来源:Transaction.cs

示例11: EnlistVolatile

 internal override Enlistment EnlistVolatile(InternalTransaction tx, ISinglePhaseNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
 {
     throw new TransactionException(System.Transactions.SR.GetString("TooLate"));
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:4,代码来源:TransactionStatePromotedPhase1.cs

示例12: EnlistVolatile

 internal virtual Enlistment EnlistVolatile(InternalTransaction tx, ISinglePhaseNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
 {
     throw TransactionException.CreateTransactionStateException(System.Transactions.SR.GetString("TraceSourceLtm"), tx.innerException);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:4,代码来源:TransactionState.cs

示例13: EnlistVolatile

 internal override Enlistment EnlistVolatile(
     InternalTransaction tx,
     ISinglePhaseNotification enlistmentNotification,
     EnlistmentOptions enlistmentOptions,
     Transaction atomicTransaction
     )
 {
     tx._promoteState.EnterState(tx);
     return tx.State.EnlistVolatile(tx, enlistmentNotification, enlistmentOptions, atomicTransaction);
 }
开发者ID:hughbe,项目名称:corefx,代码行数:10,代码来源:TransactionState.cs

示例14: DurableInternalEnlistment

 internal DurableInternalEnlistment(
     Enlistment enlistment,
     Guid resourceManagerIdentifier,
     InternalTransaction transaction, 
     IEnlistmentNotification twoPhaseNotifications,
     ISinglePhaseNotification singlePhaseNotifications,
     Transaction atomicTransaction
     ) :
     base(enlistment, transaction, twoPhaseNotifications, singlePhaseNotifications, atomicTransaction)
 {
     this.resourceManagerIdentifier = resourceManagerIdentifier;
 }
开发者ID:mind0n,项目名称:hive,代码行数:12,代码来源:Enlistment.cs

示例15: EnlistDurable

        internal override Enlistment EnlistDurable(
            InternalTransaction tx,
            Guid resourceManagerIdentifier,
            ISinglePhaseNotification enlistmentNotification,
            EnlistmentOptions enlistmentOptions,
            Transaction atomicTransaction
            )
        {
            Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction.");

            tx.ThrowIfPromoterTypeIsNotMSDTC();

            // Don't hold locks while calling into the promoted tx
            Monitor.Exit(tx);
            try
            {
                Enlistment en = new Enlistment(
                    resourceManagerIdentifier,
                    tx,
                    enlistmentNotification,
                    enlistmentNotification,
                    atomicTransaction
                    );
                EnlistmentState.EnlistmentStatePromoted.EnterState(en.InternalEnlistment);

                en.InternalEnlistment.PromotedEnlistment =
                    tx.PromotedTransaction.EnlistDurable(
                        resourceManagerIdentifier,
                        (DurableInternalEnlistment)en.InternalEnlistment,
                        true,
                        enlistmentOptions
                        );
                return en;
            }
            finally
            {
                Monitor.Enter(tx);
            }
        }
开发者ID:hughbe,项目名称:corefx,代码行数:39,代码来源:TransactionState.cs


注:本文中的ISinglePhaseNotification类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。