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
- UrlPropertyAttribute.cs
- WebPartZone.cs
- ExpressionConverter.cs
- FixedBufferAttribute.cs
- ColorConvertedBitmapExtension.cs
- ServiceEndpointAssociationProvider.cs
- CollectionEditorDialog.cs
- XappLauncher.cs
- RC2CryptoServiceProvider.cs
- TableLayoutRowStyleCollection.cs
- DispatchChannelSink.cs
- RightsManagementPermission.cs
- DataGridViewColumnHeaderCell.cs
- BrowserCapabilitiesCodeGenerator.cs
- CompilationPass2TaskInternal.cs
- SystemIcmpV4Statistics.cs
- OSEnvironmentHelper.cs
- SoapExtensionReflector.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- XomlCompilerParameters.cs
- Menu.cs
- SoapDocumentServiceAttribute.cs
- OracleBoolean.cs
- WebControlAdapter.cs
- CodeTypeMember.cs
- MasterPageCodeDomTreeGenerator.cs
- HierarchicalDataSourceControl.cs
- TrustExchangeException.cs
- BindingGroup.cs
- ThreadExceptionEvent.cs
- MetadataItemEmitter.cs
- Block.cs
- ComponentResourceManager.cs
- AdornedElementPlaceholder.cs
- TableHeaderCell.cs
- SettingsPropertyCollection.cs
- IndentedWriter.cs
- GroupQuery.cs
- UrlMappingCollection.cs
- DynamicQueryableWrapper.cs
- EnumerableCollectionView.cs
- BufferBuilder.cs
- LifetimeServices.cs
- ProxyWebPartManager.cs
- DataRecord.cs
- X509Extension.cs
- AnnotationObservableCollection.cs
- templategroup.cs
- TraceHwndHost.cs
- TriggerBase.cs
- DataObjectMethodAttribute.cs
- PageTheme.cs
- ItemContainerGenerator.cs
- ClassImporter.cs
- RecipientIdentity.cs
- ControlAdapter.cs
- ItemMap.cs
- VisualStyleRenderer.cs
- CookielessHelper.cs
- SiblingIterators.cs
- OleDbParameterCollection.cs
- OdbcPermission.cs
- AssemblyNameProxy.cs
- AsnEncodedData.cs
- Span.cs
- InputScopeAttribute.cs
- FixUp.cs
- PropertyGridCommands.cs
- CorrelationManager.cs
- FileUtil.cs
- ObjectListItemCollection.cs
- UnsupportedPolicyOptionsException.cs
- WindowsToolbarItemAsMenuItem.cs
- WebPartDisplayModeEventArgs.cs
- OrCondition.cs
- ListenerElementsCollection.cs
- ResourceFallbackManager.cs
- shaperfactoryquerycacheentry.cs
- WindowProviderWrapper.cs
- SqlRowUpdatedEvent.cs
- ConversionContext.cs
- WebConfigurationFileMap.cs
- PlaceHolder.cs
- DataKeyArray.cs
- Compiler.cs
- FontConverter.cs
- CachedRequestParams.cs
- Scene3D.cs
- Quaternion.cs
- Int32Animation.cs
- DiscoveryCallbackBehavior.cs
- OciEnlistContext.cs
- DataBoundControl.cs
- EntityViewContainer.cs
- CodeArrayCreateExpression.cs
- UpdatePanel.cs
- UnregisterInfo.cs
- NavigateEvent.cs
- DashStyle.cs
- TreeNodeClickEventArgs.cs