Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / TransactionBridge / Microsoft / Transactions / Bridge / Enlistment.cs / 1 / Enlistment.cs
//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
using System;
namespace Microsoft.Transactions.Bridge
{
[Flags]
enum Notifications
{
Phase0 = 0x000001, // Enlistment wants/will do phase-0 notifications
TwoPhaseCommit = 0x000002, // Enlistment wants/will do two phase commit notifications
Outcome = 0x000004, // Enlistment wants/will do outcome notifications
AllProtocols = (Notifications.Phase0 |
Notifications.TwoPhaseCommit |
Notifications.Outcome),
InDoubt = 0x000008, // Enlistment can handle in-doubt status reports
Volatile = 0x000010, // Enlistment should not be recovered
All = (Notifications.AllProtocols |
Notifications.InDoubt |
Notifications.Volatile)
}
///
/// The Enlistment type defines the enlistment, which is the mapping of
/// the transaction from provider to PPL to TM.
///
sealed class Enlistment
{
public Enlistment( )
{
this.localTransactionId = Guid.Empty;
this.enlistmentId = Guid.NewGuid( );
this.remoteTransactionId = null;
this.recoveryData = new byte[0];
this.transactionManagerContext = null;
this.protocolProviderContext = null;
this.notificationMask = Notifications.AllProtocols;
}
public Enlistment( Guid enlistmentId )
{
this.localTransactionId = Guid.Empty;
this.enlistmentId = enlistmentId;
this.remoteTransactionId = null;
this.recoveryData = new byte[0];
this.transactionManagerContext = null;
this.protocolProviderContext = null;
this.notificationMask = Notifications.AllProtocols;
}
public Guid EnlistmentId
{
get{ return enlistmentId; }
}
public Guid LocalTransactionId
{
get{ return localTransactionId; }
set{ localTransactionId = value; }
}
public string RemoteTransactionId
{
get{ return remoteTransactionId; }
set{ remoteTransactionId = value; }
}
public object TransactionManagerContext
{
get{ return transactionManagerContext; }
set{ transactionManagerContext = value; }
}
public object ProtocolProviderContext
{
get{ return protocolProviderContext; }
set{ protocolProviderContext = value; }
}
public byte[] GetRecoveryData()
{
return (byte[])recoveryData.Clone();
}
public void SetRecoveryData(byte[] data)
{
if (data != null)
recoveryData = (byte[])data.Clone();
else
recoveryData = new byte[0];
}
public Notifications NotificationMask
{
get { return notificationMask; }
set { notificationMask = value; }
}
override public string ToString( )
{
return this.GetType( ).ToString( ) +
" enlistment ID = " + enlistmentId.ToString( "B", null ) +
" transaction ID = " + localTransactionId.ToString( "B", null );
}
public EnlistmentOptions EnlistmentOptions
{
get{ return this.enlistmentOptions; }
set{ this.enlistmentOptions = value; }
}
//
//
//
private Guid localTransactionId;
private Guid enlistmentId;
private string remoteTransactionId;
private byte[] recoveryData;
private Notifications notificationMask;
private EnlistmentOptions enlistmentOptions;
private object transactionManagerContext;
private object protocolProviderContext;
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Int32Rect.cs
- ResourceDictionaryCollection.cs
- ListenUriMode.cs
- ProxyManager.cs
- SiteMapNodeItem.cs
- GlobalizationAssembly.cs
- BufferModeSettings.cs
- TagNameToTypeMapper.cs
- StylusPlugInCollection.cs
- Unit.cs
- SecurityDescriptor.cs
- TimeSpanValidator.cs
- HttpResponse.cs
- TemplateManager.cs
- WindowsToolbarAsMenu.cs
- InheritanceRules.cs
- RegexWorker.cs
- ConstrainedDataObject.cs
- XmlTextReaderImplHelpers.cs
- ComponentSerializationService.cs
- ManualResetEvent.cs
- FlowDocumentPage.cs
- RedistVersionInfo.cs
- ListViewSortEventArgs.cs
- WebChannelFactory.cs
- TextTreeUndoUnit.cs
- SessionPageStateSection.cs
- ByteKeyFrameCollection.cs
- EventBuilder.cs
- Assembly.cs
- MobileControl.cs
- WebDescriptionAttribute.cs
- WindowHelperService.cs
- SendMailErrorEventArgs.cs
- CacheModeValueSerializer.cs
- ISCIIEncoding.cs
- ViewGenResults.cs
- BamlLocalizabilityResolver.cs
- Exceptions.cs
- XsltArgumentList.cs
- GridView.cs
- TableRowGroup.cs
- UIntPtr.cs
- _KerberosClient.cs
- ObfuscateAssemblyAttribute.cs
- AssemblySettingAttributes.cs
- TypeSource.cs
- DeleteIndexBinder.cs
- DrawListViewItemEventArgs.cs
- ColorTranslator.cs
- Timer.cs
- CookieParameter.cs
- BookmarkCallbackWrapper.cs
- SectionVisual.cs
- FileSystemEventArgs.cs
- SqlMultiplexer.cs
- SimplePropertyEntry.cs
- ReplacementText.cs
- Rect3DConverter.cs
- TableColumn.cs
- DataGridViewAddColumnDialog.cs
- IPipelineRuntime.cs
- HMACMD5.cs
- WebPartTransformer.cs
- ReflectionServiceProvider.cs
- FunctionGenerator.cs
- Error.cs
- CodeCatchClauseCollection.cs
- HwndProxyElementProvider.cs
- HttpPostedFile.cs
- HttpConfigurationContext.cs
- SamlAuthorizationDecisionClaimResource.cs
- HtmlHead.cs
- ThreadStartException.cs
- ToolStripGrip.cs
- TypeConverterValueSerializer.cs
- InternalsVisibleToAttribute.cs
- ReadContentAsBinaryHelper.cs
- DataKey.cs
- PreservationFileWriter.cs
- EnumValAlphaComparer.cs
- SystemBrushes.cs
- XmlJsonWriter.cs
- ScriptIgnoreAttribute.cs
- UrlParameterReader.cs
- HandoffBehavior.cs
- SettingsBindableAttribute.cs
- MsdtcClusterUtils.cs
- DetailsViewUpdateEventArgs.cs
- Brushes.cs
- BindStream.cs
- StrongTypingException.cs
- WebPartsSection.cs
- HandledMouseEvent.cs
- ToolboxBitmapAttribute.cs
- SplayTreeNode.cs
- NativeCompoundFileAPIs.cs
- Listen.cs
- TemplatePropertyEntry.cs
- LoginName.cs