本文整理汇总了C#中IEnlistmentNotification类的典型用法代码示例。如果您正苦于以下问题:C# IEnlistmentNotification类的具体用法?C# IEnlistmentNotification怎么用?C# IEnlistmentNotification使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IEnlistmentNotification类属于命名空间,在下文中一共展示了IEnlistmentNotification类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EnlistVolatile
/// <summary>
/// Enlists a resource manager in this transaction.
/// </summary>
/// <param name="p_entNotification">The resource manager to enlist.</param>
/// <param name="p_eopOptions">The enlistment options. This value must be <see cref="EnlistmentOptions.None"/>.</param>
/// <exception cref="ArgumentException">Thrown if <paramref name="p_eopOptions"/> is not
/// <see cref="EnlistmentOptions.None"/>.</exception>
public void EnlistVolatile(IEnlistmentNotification p_entResourceManager, EnlistmentOptions p_eopOptions)
{
if (p_eopOptions != EnlistmentOptions.None)
throw new ArgumentException("EnlistmentOptions must be None.", "p_eopOptions");
m_lstNotifications.Add(p_entResourceManager);
}
示例2: InternalEnlistment
internal InternalEnlistment(System.Transactions.Enlistment enlistment, IEnlistmentNotification twoPhaseNotifications, InternalTransaction transaction, System.Transactions.Transaction atomicTransaction)
{
this.enlistment = enlistment;
this.twoPhaseNotifications = twoPhaseNotifications;
this.transaction = transaction;
this.atomicTransaction = atomicTransaction;
}
示例3: TestInitialize
public void TestInitialize()
{
target = new TransactionEnlistmentHelper();
ensureTransaction = true;
options = EnlistmentOptions.None;
enlistmentNotification = MockRepository.GenerateMock<IEnlistmentNotification>();
enlistmentNotification.Expect( en => en.Prepare( null ) )
.IgnoreArguments()
.WhenCalled( a =>
{
PreparingEnlistment e = a.Arguments.GetValue( 0 ) as PreparingEnlistment;
e.Prepared();
} )
.Repeat.Once();
enlistmentNotification.Expect( en => en.Commit( null ) )
.IgnoreArguments()
.WhenCalled( a =>
{
Enlistment e = a.Arguments.GetValue( 0 ) as Enlistment;
e.Done();
} )
.Repeat.Once();
}
示例4: InternalEnlistment
// For Recovering Enlistments
protected InternalEnlistment(
Enlistment enlistment,
IEnlistmentNotification twoPhaseNotifications
)
{
Debug.Assert(this is RecoveringInternalEnlistment, "this is RecoveringInternalEnlistment");
this.enlistment = enlistment;
this.twoPhaseNotifications = twoPhaseNotifications;
this.enlistmentId = 1;
this.traceIdentifier = EnlistmentTraceIdentifier.Empty;
}
示例5: 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);
}
}
示例6: Enlistment
internal Enlistment(
Guid resourceManagerIdentifier,
InternalTransaction transaction,
IEnlistmentNotification twoPhaseNotifications,
ISinglePhaseNotification singlePhaseNotifications,
Transaction atomicTransaction)
{
_internalEnlistment = new DurableInternalEnlistment(
this,
resourceManagerIdentifier,
transaction,
twoPhaseNotifications,
singlePhaseNotifications,
atomicTransaction
);
}
示例7: EnlistVolatile
internal override Enlistment EnlistVolatile(InternalTransaction tx, IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
{
Enlistment enlistment = new Enlistment(tx, enlistmentNotification, null, 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;
}
示例8: EnlistVolatile
public Enlistment EnlistVolatile(IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions)
{
}
示例9: EnlistVolatile
internal virtual Enlistment EnlistVolatile(InternalTransaction tx, IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
{
throw TransactionException.CreateTransactionStateException(System.Transactions.SR.GetString("TraceSourceLtm"), tx.innerException);
}
示例10: EnlistDurable
public Enlistment EnlistDurable(System.Guid resourceManagerIdentifier, IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions)
{
}
示例11: Enlistment
internal Enlistment(
IEnlistmentNotification twoPhaseNotifications,
object syncRoot
)
{
this.internalEnlistment = new RecoveringInternalEnlistment(
this,
twoPhaseNotifications,
syncRoot
);
}
示例12: PreparingEnlistment
internal PreparingEnlistment (Transaction tx, IEnlistmentNotification enlisted)
{
this.tx = tx;
this.enlisted = enlisted;
waitHandle = new ManualResetEvent (false);
}
示例13: EnlistVolatileInternal
private Enlistment EnlistVolatileInternal (
IEnlistmentNotification notification,
EnlistmentOptions options)
{
EnsureIncompleteCurrentScope ();
/* FIXME: Handle options.EnlistDuringPrepareRequired */
Volatiles.Add (notification);
/* FIXME: Enlistment.. ? */
return new Enlistment ();
}
示例14: Rollback
internal void Rollback (Exception ex, IEnlistmentNotification enlisted)
{
if (aborted)
return;
/* See test ExplicitTransaction7 */
if (info.Status == TransactionStatus.Committed)
throw new TransactionException ("Transaction has already been committed. Cannot accept any new work.");
innerException = ex;
Enlistment e = new Enlistment ();
foreach (IEnlistmentNotification prep in volatiles)
if (prep != enlisted)
prep.Rollback (e);
if (durables.Count > 0 && durables [0] != enlisted)
durables [0].Rollback (e);
Aborted = true;
}
示例15: DurableInternalEnlistment
protected DurableInternalEnlistment(
Enlistment enlistment,
IEnlistmentNotification twoPhaseNotifications
) : base(enlistment, twoPhaseNotifications)
{
}