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
- BuiltInPermissionSets.cs
- Deserializer.cs
- RangeValuePattern.cs
- CaseInsensitiveHashCodeProvider.cs
- XmlSignatureProperties.cs
- DbParameterCollection.cs
- CacheForPrimitiveTypes.cs
- HttpCapabilitiesEvaluator.cs
- DeadCharTextComposition.cs
- Font.cs
- EntityStoreSchemaGenerator.cs
- ConversionContext.cs
- QueryOpcode.cs
- WhitespaceRuleLookup.cs
- GenericEnumConverter.cs
- SortDescriptionCollection.cs
- XmlSchemaSimpleTypeList.cs
- SystemResourceKey.cs
- HashMembershipCondition.cs
- ValueTypeIndexerReference.cs
- DES.cs
- ReferenceSchema.cs
- OutputWindow.cs
- FactoryGenerator.cs
- EventWaitHandle.cs
- SettingsPropertyCollection.cs
- ChangePassword.cs
- XamlPathDataSerializer.cs
- BuildDependencySet.cs
- HotCommands.cs
- CompilerGeneratedAttribute.cs
- IndentTextWriter.cs
- WizardStepCollectionEditor.cs
- CustomAttributeFormatException.cs
- Pen.cs
- Utils.cs
- PointCollection.cs
- PermissionToken.cs
- MultiplexingFormatMapping.cs
- EnvironmentPermission.cs
- CodeArgumentReferenceExpression.cs
- TypeValidationEventArgs.cs
- NullableFloatSumAggregationOperator.cs
- CodeIterationStatement.cs
- OdbcInfoMessageEvent.cs
- DbConnectionPoolGroup.cs
- BitmapVisualManager.cs
- serverconfig.cs
- CodeNamespaceImport.cs
- TraceXPathNavigator.cs
- DbgUtil.cs
- WebPartDescription.cs
- NonSerializedAttribute.cs
- EntityContainerEntitySetDefiningQuery.cs
- ObjectAnimationUsingKeyFrames.cs
- CellParagraph.cs
- MissingSatelliteAssemblyException.cs
- InfoCardAsymmetricCrypto.cs
- ProxySimple.cs
- ReversePositionQuery.cs
- DBCommandBuilder.cs
- DBSchemaTable.cs
- WebHttpSecurityModeHelper.cs
- BamlRecords.cs
- EdmItemError.cs
- RijndaelManaged.cs
- DataGridViewCheckBoxCell.cs
- UnsafeNativeMethods.cs
- RoleManagerEventArgs.cs
- DictionaryEntry.cs
- ToolStripContainer.cs
- Hyperlink.cs
- FormViewUpdatedEventArgs.cs
- PortCache.cs
- CacheForPrimitiveTypes.cs
- _NetRes.cs
- ConfigurationSettings.cs
- TypeConverterHelper.cs
- DesignerVerbCollection.cs
- UInt16.cs
- RSAPKCS1SignatureDeformatter.cs
- DbMetaDataFactory.cs
- TextServicesCompartment.cs
- Font.cs
- UIElementIsland.cs
- Normalization.cs
- AssemblyCache.cs
- CodeGroup.cs
- HttpHandlersInstallComponent.cs
- MouseGestureValueSerializer.cs
- SafeRsaProviderHandle.cs
- WhitespaceRule.cs
- ButtonChrome.cs
- Formatter.cs
- ProfilePropertySettingsCollection.cs
- PageAdapter.cs
- RetrieveVirtualItemEventArgs.cs
- ETagAttribute.cs
- VisualStyleRenderer.cs
- NotifyCollectionChangedEventArgs.cs