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
- TextEditorCopyPaste.cs
- CodeSnippetCompileUnit.cs
- Currency.cs
- DynamicFilter.cs
- TabPanel.cs
- ItemCheckedEvent.cs
- BamlTreeNode.cs
- DbConnectionPoolGroupProviderInfo.cs
- WsatServiceAddress.cs
- UmAlQuraCalendar.cs
- AssemblyCache.cs
- DayRenderEvent.cs
- SoapServerMessage.cs
- SafeHandles.cs
- ApplicationDirectoryMembershipCondition.cs
- Queue.cs
- FocusWithinProperty.cs
- EntityViewGenerationAttribute.cs
- NumberSubstitution.cs
- XmlSerializerFactory.cs
- XmlEntityReference.cs
- MessageTransmitTraceRecord.cs
- ContextQuery.cs
- RandomNumberGenerator.cs
- ACL.cs
- ToolStripCollectionEditor.cs
- PtsHost.cs
- DataSourceSelectArguments.cs
- CharUnicodeInfo.cs
- ValidateNames.cs
- ListControl.cs
- CultureTable.cs
- ReadOnlyDataSource.cs
- PlanCompilerUtil.cs
- OleDbConnectionInternal.cs
- VirtualPathUtility.cs
- NotificationContext.cs
- TypeConverter.cs
- WebPartConnectionsConfigureVerb.cs
- SystemWebCachingSectionGroup.cs
- GetIsBrowserClientRequest.cs
- InputEventArgs.cs
- ElementFactory.cs
- Assign.cs
- XmlMapping.cs
- TreeNodeCollectionEditorDialog.cs
- PropertySegmentSerializationProvider.cs
- Logging.cs
- GeometryModel3D.cs
- Matrix3DConverter.cs
- initElementDictionary.cs
- HandleValueEditor.cs
- ObjectIDGenerator.cs
- ListViewCommandEventArgs.cs
- FormView.cs
- ByteKeyFrameCollection.cs
- DataRowCollection.cs
- uribuilder.cs
- HttpCacheVaryByContentEncodings.cs
- TypedTableBase.cs
- webproxy.cs
- NumberFormatter.cs
- DESCryptoServiceProvider.cs
- FormattedText.cs
- SrgsGrammarCompiler.cs
- RightsManagementEncryptionTransform.cs
- WebDescriptionAttribute.cs
- SuppressMessageAttribute.cs
- FixedPageStructure.cs
- Calendar.cs
- loginstatus.cs
- ModelChangedEventArgsImpl.cs
- MetadataArtifactLoaderComposite.cs
- MatrixCamera.cs
- ToolStripOverflow.cs
- CheckoutException.cs
- ReachDocumentReferenceCollectionSerializer.cs
- ItemCollectionEditor.cs
- CompensationToken.cs
- StorageComplexPropertyMapping.cs
- ClientRuntimeConfig.cs
- COM2ExtendedTypeConverter.cs
- TextLineBreak.cs
- PointLight.cs
- XmlSchemaValidationException.cs
- DataRecordInfo.cs
- IndependentAnimationStorage.cs
- EventSource.cs
- DataGridToolTip.cs
- ChineseLunisolarCalendar.cs
- Bold.cs
- ZoneIdentityPermission.cs
- KnowledgeBase.cs
- RegexCapture.cs
- WorkerRequest.cs
- ParenExpr.cs
- ColorTransform.cs
- RoutedCommand.cs
- WhiteSpaceTrimStringConverter.cs
- DataProtection.cs