2 // PreparingEnlistment.cs
5 // Atsushi Enomoto <atsushi@ximian.com>
6 // Ankit Jain <JAnkit@novell.com>
13 using System.Threading;
15 namespace System.Transactions
17 public class PreparingEnlistment : Enlistment
19 bool prepared = false;
21 IEnlistmentNotification enlisted;
22 WaitHandle waitHandle;
25 internal PreparingEnlistment (Transaction tx, IEnlistmentNotification enlisted)
28 this.enlisted = enlisted;
29 waitHandle = new ManualResetEvent (false);
32 public void ForceRollback ()
37 internal override void InternalOnDone ()
43 public void ForceRollback (Exception ex)
45 tx.Rollback (ex, enlisted);
46 /* See test RMFail2 */
47 ((ManualResetEvent) waitHandle).Set ();
51 public void Prepared ()
54 /* See test RMFail2 */
55 ((ManualResetEvent) waitHandle).Set ();
59 public byte [] RecoveryInformation ()
61 throw new NotImplementedException ();
64 internal bool IsPrepared {
65 get { return prepared; }
68 internal WaitHandle WaitHandle {
69 get { return waitHandle; }
72 internal IEnlistmentNotification EnlistmentNotification
74 get { return enlisted; }
77 // Uncatched exceptions thrown during prepare will
78 // be saved here so they can be retrieved by TM.
79 internal Exception Exception