Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / TransactionBridge / Microsoft / Transactions / Wsat / InputOutput / Activation.cs / 1 / Activation.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- // This file implements activation-related messaging using System; using System.ServiceModel.Channels; using System.Diagnostics; using System.ServiceModel; using System.Xml; using Microsoft.Transactions.Wsat.Messaging; using Microsoft.Transactions.Wsat.Protocol; using Microsoft.Transactions.Wsat.StateMachines; namespace Microsoft.Transactions.Wsat.InputOutput { class ActivationCoordinator : IActivationCoordinator { ProtocolState state; public ActivationCoordinator (ProtocolState state) { this.state = state; } // // IActivationCoordinator // public void CreateCoordinationContext(Message message, RequestAsyncResult result) { CreateCoordinationContext create = new CreateCoordinationContext (message, this.state.ProtocolVersion); CoordinationContext context = create.CurrentContext; if (context == null) { CompletionEnlistment completion = new CompletionEnlistment(state); completion.StateMachine.Enqueue(new MsgCreateTransactionEvent(completion, ref create, result)); } else { // Find or create a new transaction context manager TransactionContextManager contextManager; contextManager = state.Lookup.FindTransactionContextManager(context.Identifier); if (contextManager == null) { contextManager = new TransactionContextManager(state, context.Identifier); bool found; contextManager = state.Lookup.FindOrAddTransactionContextManager(contextManager, out found); } // We can't just return contextManager.TransactionContext, since we may not be in a state // for which that property is valid. The state machine is wise and will take things from here. contextManager.StateMachine.Enqueue(new TransactionContextEnlistTransactionEvent(contextManager, ref create, result)); } } // // Sending messages // public void SendCreateCoordinationContextResponse(TransactionContext txContext, RequestAsyncResult result) { CreateCoordinationContextResponse response = new CreateCoordinationContextResponse(this.state.ProtocolVersion); response.CoordinationContext = txContext.CoordinationContext; response.IssuedToken = txContext.IssuedToken; if (DebugTrace.Info) { DebugTrace.Trace(TraceLevel.Info, "Sending CreateCoordinationContextResponse"); } ActivationProxy.SendCreateCoordinationContextResponse(result, ref response); } public void SendFault(RequestAsyncResult result, Microsoft.Transactions.Wsat.Messaging.Fault fault) { state.Perf.FaultsSentCountPerInterval.Increment(); if (DebugTrace.Warning) { DebugTrace.Trace(TraceLevel.Warning, "Sending {0} fault to activation participant", fault.Code.Name); } ActivationProxy.SendFaultResponse (result, fault); } } } // 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
- XmlSiteMapProvider.cs
- Context.cs
- CodeNamespaceCollection.cs
- WebBrowserNavigatedEventHandler.cs
- TransportChannelFactory.cs
- SqlAliasesReferenced.cs
- DataGridColumn.cs
- GroupBoxRenderer.cs
- RIPEMD160Managed.cs
- AssemblyLoader.cs
- UrlPath.cs
- Vector.cs
- UnsafeNativeMethodsPenimc.cs
- ButtonFieldBase.cs
- NavigationPropertyEmitter.cs
- PropertyCondition.cs
- WindowsListViewGroup.cs
- DeferredBinaryDeserializerExtension.cs
- AuthorizationContext.cs
- FlowDocument.cs
- PackageStore.cs
- UnknownWrapper.cs
- VisualStyleRenderer.cs
- FormsAuthenticationCredentials.cs
- MetafileHeaderEmf.cs
- EdmFunction.cs
- DynamicDiscoveryDocument.cs
- HashHelper.cs
- SingletonConnectionReader.cs
- SQLRoleProvider.cs
- HMACRIPEMD160.cs
- RankException.cs
- GeometryModel3D.cs
- LogLogRecord.cs
- HuffmanTree.cs
- ClientCredentialsSecurityTokenManager.cs
- NonClientArea.cs
- XmlSchemaAnnotated.cs
- PerspectiveCamera.cs
- ImageCodecInfoPrivate.cs
- HMACSHA1.cs
- PointCollection.cs
- DebugView.cs
- TextProviderWrapper.cs
- RowsCopiedEventArgs.cs
- FlowLayoutSettings.cs
- BrowserCapabilitiesFactory.cs
- PreProcessInputEventArgs.cs
- SelectionRange.cs
- ResourceBinder.cs
- TrackingMemoryStream.cs
- BindingListCollectionView.cs
- DataTableMappingCollection.cs
- DateBoldEvent.cs
- MaskPropertyEditor.cs
- ItemsPresenter.cs
- PersonalizationState.cs
- IndentedWriter.cs
- TriggerCollection.cs
- RelativeSource.cs
- FontWeight.cs
- SessionStateUtil.cs
- SqlUDTStorage.cs
- JumpList.cs
- FrugalList.cs
- HandleExceptionArgs.cs
- XmlAttribute.cs
- XmlNamespaceManager.cs
- Overlapped.cs
- UxThemeWrapper.cs
- WebPartMovingEventArgs.cs
- InnerItemCollectionView.cs
- SiteOfOriginContainer.cs
- VsPropertyGrid.cs
- ReflectionUtil.cs
- Parameter.cs
- RichTextBoxAutomationPeer.cs
- RelOps.cs
- PolyQuadraticBezierSegment.cs
- IDReferencePropertyAttribute.cs
- TextBoxView.cs
- LinkedList.cs
- MaskedTextProvider.cs
- DbQueryCommandTree.cs
- PackageDigitalSignature.cs
- SerialPinChanges.cs
- RectAnimationClockResource.cs
- PermissionSetTriple.cs
- ObjectDataSourceMethodEventArgs.cs
- input.cs
- DataGridCommandEventArgs.cs
- KeyToListMap.cs
- HttpWebResponse.cs
- WindowsHyperlink.cs
- SpoolingTaskBase.cs
- XamlSerializationHelper.cs
- DataColumnMappingCollection.cs
- FixedNode.cs
- DataColumnPropertyDescriptor.cs
- TimerElapsedEvenArgs.cs