2 // PreparingEnlistment.cs
5 // Atsushi Enomoto <atsushi@ximian.com>
6 // Ankit Jain <JAnkit@novell.com>
14 using System.Threading;
16 namespace System.Transactions
18 public class PreparingEnlistment : Enlistment
20 bool prepared = false;
22 IEnlistmentNotification enlisted;
23 WaitHandle waitHandle;
26 internal PreparingEnlistment (Transaction tx, IEnlistmentNotification enlisted)
29 this.enlisted = enlisted;
30 waitHandle = new ManualResetEvent (false);
33 public void ForceRollback ()
38 internal override void InternalOnDone ()
44 public void ForceRollback (Exception ex)
46 tx.Rollback (ex, enlisted);
47 /* See test RMFail2 */
48 ((ManualResetEvent) waitHandle).Set ();
52 public void Prepared ()
55 /* See test RMFail2 */
56 ((ManualResetEvent) waitHandle).Set ();
60 public byte [] RecoveryInformation ()
62 throw new NotImplementedException ();
65 internal bool IsPrepared {
66 get { return prepared; }
69 internal WaitHandle WaitHandle {
70 get { return waitHandle; }
73 internal IEnlistmentNotification EnlistmentNotification
75 get { return enlisted; }
78 // Uncatched exceptions thrown during prepare will
79 // be saved here so they can be retrieved by TM.
80 internal Exception Exception