Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / TransactionBridge / Microsoft / Transactions / Wsat / StateMachines / Subordinate.cs / 1 / Subordinate.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- // This file contains the the implementations of the various states used by the // Subordinate state machine, which handles incoming activation and registration events // for transactions with DTC as superior and no WS-AT coordinator. // // This is a somewhat special state machine, in that it has no "active" states using System; using System.Diagnostics; using Microsoft.Transactions.Bridge; using Microsoft.Transactions.Wsat.Messaging; using Microsoft.Transactions.Wsat.InputOutput; using Microsoft.Transactions.Wsat.Protocol; using Fault = Microsoft.Transactions.Wsat.Messaging.Fault; namespace Microsoft.Transactions.Wsat.StateMachines { //============================================================================= // SubordinateInitializing // // A CreateCoordinationContext message was received // DTC already knew about the transaction, so we can't be superior to DTC // We will therefore be subordinate to DTC for the transaction //============================================================================= class SubordinateInitializing : InactiveState { public SubordinateInitializing(ProtocolState state) : base(state) { } public override void OnEvent(InternalEnlistSubordinateTransactionEvent e) { ParticipantEnlistment participant = e.Participant; state.TransactionManagerSend.Register(participant, e); participant.StateMachine.ChangeState(state.States.SubordinateRegistering); } } //============================================================================== // SubordinateRegistering // // We asked the TM to create a new subordinate enlistment //============================================================================= class SubordinateRegistering : InactiveState { public SubordinateRegistering(ProtocolState state) : base(state) { } public override void OnEvent(TmSubordinateRegisterResponseEvent e) { ParticipantEnlistment participant = e.Participant; Status status = e.Status; if (status == Status.Success) { participant.OnSubordinateRegistered(); participant.StateMachine.ChangeState(state.States.SubordinateActive); } else { if (status == Status.TransactionNotFound && !state.TransactionManager.Settings.NetworkInboundAccess) { participant.ContextManager.Fault = this.state.Faults.SubordinateRegistrationNetAccessDisabled; } else { participant.ContextManager.Fault = this.state.Faults.SubordinateTMRegistrationFailed(status); } participant.StateMachine.ChangeState(state.States.SubordinateFinished); } } } //============================================================================== // SubordinateActive // // A dummy subordinate was created for the enlistment // We await news from the transaction manager //============================================================================== class SubordinateActive : InactiveState { public SubordinateActive(ProtocolState state) : base(state) { } public override void OnEvent(TmPrepareEvent e) { ParticipantEnlistment participant = e.Participant; participant.SetCallback(e.Callback, e.CallbackState); state.TransactionManagerSend.ReadOnly(participant); participant.StateMachine.ChangeState(state.States.SubordinateFinished); } public override void OnEvent(TmRollbackEvent e) { ParticipantEnlistment participant = e.Participant; participant.SetCallback(e.Callback, e.CallbackState); state.TransactionManagerSend.Aborted(participant); participant.StateMachine.ChangeState(state.States.SubordinateFinished); } } //============================================================================= // SubordinateFinished // // The subordinate enlistment has ended //============================================================================== class SubordinateFinished : TerminalState { public SubordinateFinished(ProtocolState state) : base(state) { } } } // 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
- Configuration.cs
- HttpCookie.cs
- MeasureData.cs
- Control.cs
- SortKey.cs
- RoleGroupCollection.cs
- COAUTHINFO.cs
- Util.cs
- BitmapCodecInfo.cs
- Dispatcher.cs
- TagMapCollection.cs
- dbenumerator.cs
- assertwrapper.cs
- DataGrid.cs
- RotateTransform3D.cs
- Viewport2DVisual3D.cs
- ComponentConverter.cs
- BindingExpressionUncommonField.cs
- DelegatingMessage.cs
- CriticalExceptions.cs
- newinstructionaction.cs
- SupportsEventValidationAttribute.cs
- FieldToken.cs
- RawStylusInput.cs
- CssTextWriter.cs
- HtmlHead.cs
- TerminateDesigner.cs
- Accessible.cs
- SystemParameters.cs
- DispatcherBuilder.cs
- Grid.cs
- HandlerMappingMemo.cs
- GreenMethods.cs
- PathSegment.cs
- NativeActivityContext.cs
- ValueChangedEventManager.cs
- COM2TypeInfoProcessor.cs
- TriggerBase.cs
- XmlEnumAttribute.cs
- PersonalizationProviderCollection.cs
- _HeaderInfo.cs
- _DomainName.cs
- TabRenderer.cs
- NullableIntMinMaxAggregationOperator.cs
- DecimalAnimation.cs
- CultureInfoConverter.cs
- NumberFunctions.cs
- TableParaClient.cs
- AssemblyCacheEntry.cs
- EntityModelBuildProvider.cs
- RegexFCD.cs
- NativeRightsManagementAPIsStructures.cs
- SqlReferenceCollection.cs
- SqlWriter.cs
- storepermission.cs
- Update.cs
- XmlSchemaSimpleContentRestriction.cs
- Vector3DCollectionValueSerializer.cs
- FontStretches.cs
- SByte.cs
- MiniLockedBorderGlyph.cs
- IsolatedStorageException.cs
- DBSchemaTable.cs
- ImageMapEventArgs.cs
- ImageAutomationPeer.cs
- DataBindEngine.cs
- MissingSatelliteAssemblyException.cs
- ProjectionPath.cs
- BaseEntityWrapper.cs
- PersonalizationEntry.cs
- WebBrowser.cs
- IdnMapping.cs
- InvalidOperationException.cs
- LongSumAggregationOperator.cs
- XpsImage.cs
- WindowsImpersonationContext.cs
- HttpTransportSecurity.cs
- figurelengthconverter.cs
- ExpandedWrapper.cs
- lengthconverter.cs
- XmlSchemaInfo.cs
- IDReferencePropertyAttribute.cs
- OutputCacheSettings.cs
- GroupBoxAutomationPeer.cs
- NavigateEvent.cs
- clipboard.cs
- ScrollBar.cs
- ModulesEntry.cs
- RouteItem.cs
- QualifierSet.cs
- Compiler.cs
- Rect3D.cs
- RuntimeHandles.cs
- SystemIcmpV6Statistics.cs
- ProtocolViolationException.cs
- ImageSourceValueSerializer.cs
- DbBuffer.cs
- IPAddress.cs
- DependencyObject.cs
- DrawingState.cs