Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / TransactionBridge / Microsoft / Transactions / Wsat / Protocol / DebugTracing.cs / 1 / DebugTracing.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- // This file contains debug tracing support for the WS-AT protocol using System; using System.ServiceModel.Channels; using System.Diagnostics; using System.Globalization; using System.ServiceModel; using System.Threading; using Microsoft.Transactions.Bridge; using Microsoft.Transactions.Wsat.Messaging; using Microsoft.Transactions.Wsat.InputOutput; using Microsoft.Transactions.Wsat.StateMachines; namespace Microsoft.Transactions.Wsat.Protocol { class DebugTracingEventSink : IIncomingEventSink { // // Generic trace methods // void TraceGenericEvent (SynchronizationEvent e) { DebugTrace.TxTrace (TraceLevel.Info, e.Enlistment.EnlistmentId, "{0}", e); } void TraceNotificationMessage (CompletionEvent e) { DebugTrace.TxTrace ( TraceLevel.Info, e.Enlistment.EnlistmentId, "{0} from {1}", e, Ports.TryGetAddress (e.Completion.ParticipantProxy) ); } void TraceNotificationMessage (CoordinatorEvent e) { DebugTrace.TxTrace ( TraceLevel.Info, e.Enlistment.EnlistmentId, "{0} from {1}", e, Ports.TryGetAddress (e.Coordinator.CoordinatorProxy) ); } void TraceNotificationMessage (VolatileCoordinatorEvent e) { DebugTrace.TxTrace ( TraceLevel.Info, e.Enlistment.EnlistmentId, "{0} from {1}", e, Ports.TryGetAddress (e.VolatileCoordinator.CoordinatorProxy) ); } void TraceNotificationMessage (ParticipantEvent e) { DebugTrace.TxTrace ( TraceLevel.Info, e.Enlistment.EnlistmentId, "{0} from {1}", e, Ports.TryGetAddress (e.Participant.ParticipantProxy) ); } void TraceTmEvent (ParticipantCallbackEvent e) { DebugTrace.TxTrace( TraceLevel.Info, e.Enlistment.EnlistmentId, "{0} for {1}", e, Ports.TryGetAddress(e.Participant.ParticipantProxy) ); } void TraceTmResponse (SynchronizationEvent e, Status status) { DebugTrace.TxTrace ( TraceLevel.Info, e.Enlistment.EnlistmentId, "{0} {1}", e, status ); } void TraceTmEvent (CoordinatorCallbackEvent e) { DebugTrace.TxTrace ( TraceLevel.Info, e.Enlistment.EnlistmentId, "{0} for {1}", e, Ports.TryGetAddress (e.Coordinator.CoordinatorProxy) ); } void TraceFault (MessageFault fault, SynchronizationEvent e) { DebugTrace.TxTrace ( TraceLevel.Info, e.Enlistment.EnlistmentId, "{0} {1}: {2}", e, Library.GetFaultCodeName(fault), Library.GetFaultCodeReason(fault) ); } // // IIncomingEventSink implementation // public void OnEvent(MsgCreateTransactionEvent e) { DebugTrace.TxTrace ( TraceLevel.Info, e.Enlistment.EnlistmentId, "{0}", e ); } public void OnEvent(MsgEnlistTransactionEvent e) { DebugTrace.TxTrace ( TraceLevel.Info, e.Enlistment.EnlistmentId, "{0}{1}", e, e.Body.IssuedToken != null ? " with issued token" : string.Empty ); } public void OnEvent(TmCreateTransactionResponseEvent e) { DebugTrace.TxTrace ( TraceLevel.Info, e.Enlistment.EnlistmentId, "{0} {1}", e, e.Status ); } public void OnEvent(TmEnlistTransactionResponseEvent e) { DebugTrace.TxTrace ( TraceLevel.Info, e.Enlistment.EnlistmentId, "{0} {1}", e, e.Status ); } public void OnEvent(MsgRegisterCompletionEvent e) { DebugTrace.TxTrace ( TraceLevel.Info, e.Enlistment.EnlistmentId, "{0} for {1} at {2}", e, ControlProtocol.Completion, Ports.TryGetAddress (e.Proxy) ); } public void OnEvent(MsgRegisterDurableResponseEvent e) { DebugTrace.TxTrace ( TraceLevel.Info, e.Enlistment.EnlistmentId, "{0} from {1}", e, Ports.TryGetAddress (e.Coordinator.RegistrationProxy) ); } public void OnEvent(MsgRegisterVolatileResponseEvent e) { DebugTrace.TxTrace ( TraceLevel.Info, e.Enlistment.EnlistmentId, "{0} from {1}", e, Ports.TryGetAddress (e.VolatileCoordinator.Coordinator.RegistrationProxy) ); } public void OnEvent(MsgRegistrationCoordinatorFaultEvent e) { TraceFault (e.Fault, e); } public void OnEvent(MsgRegistrationCoordinatorSendFailureEvent e) { TraceGenericEvent (e); } public void OnEvent(TmRegisterResponseEvent e) { DebugTrace.TxTrace ( TraceLevel.Info, e.Enlistment.EnlistmentId, "{0} {1} for {2}", e, e.Status, e.Participant.ControlProtocol ); } public void OnEvent(TmSubordinateRegisterResponseEvent e) { DebugTrace.TxTrace ( TraceLevel.Info, e.Enlistment.EnlistmentId, "{0} {1} for {2}", e, e.Status, e.Participant.ControlProtocol ); } public void OnEvent(TmEnlistPrePrepareEvent e) { TraceGenericEvent (e); } public void OnEvent(MsgCompletionCommitEvent e) { TraceNotificationMessage (e); } public void OnEvent(MsgCompletionRollbackEvent e) { TraceNotificationMessage (e); } public void OnEvent(TmCompletionCommitResponseEvent e) { TraceTmResponse (e, e.Status); } public void OnEvent(TmCompletionRollbackResponseEvent e) { TraceTmResponse (e, e.Status); } public void OnEvent(MsgVolatilePrepareEvent e) { TraceNotificationMessage (e); } public void OnEvent(MsgDurablePrepareEvent e) { TraceNotificationMessage (e); } public void OnEvent(MsgVolatileCommitEvent e) { TraceNotificationMessage(e); } public void OnEvent(MsgDurableCommitEvent e) { TraceNotificationMessage (e); } public void OnEvent(MsgVolatileRollbackEvent e) { TraceNotificationMessage (e); } public void OnEvent(MsgDurableRollbackEvent e) { TraceNotificationMessage (e); } public void OnEvent(MsgDurableCoordinatorFaultEvent e) { TraceFault (e.Fault, e); } public void OnEvent(MsgVolatileCoordinatorFaultEvent e) { TraceFault (e.Fault, e); } public void OnEvent(MsgDurableCoordinatorSendFailureEvent e) { TraceGenericEvent (e); } public void OnEvent(MsgVolatileCoordinatorSendFailureEvent e) { TraceGenericEvent (e); } public void OnEvent(MsgPreparedEvent e) { TraceNotificationMessage (e); } public void OnEvent(MsgAbortedEvent e) { TraceNotificationMessage (e); } public void OnEvent(MsgReadOnlyEvent e) { TraceNotificationMessage (e); } public void OnEvent(MsgCommittedEvent e) { TraceNotificationMessage (e); } public void OnEvent(MsgReplayEvent e) { TraceNotificationMessage (e); } public void OnEvent(MsgParticipantFaultEvent e) { TraceFault (e.Fault, e); } public void OnEvent(MsgParticipantSendFailureEvent e) { TraceGenericEvent (e); } public void OnEvent(TmPrePrepareResponseEvent e) { TraceTmResponse (e, e.Status); } public void OnEvent(TmPrepareResponseEvent e) { TraceTmResponse (e, e.Status); } public void OnEvent(TmCommitResponseEvent e) { TraceTmResponse (e, e.Status); } public void OnEvent(TmRollbackResponseEvent e) { TraceTmResponse (e, e.Status); } public void OnEvent(TmPrePrepareEvent e) { TraceTmEvent (e); } public void OnEvent(TmPrepareEvent e) { TraceTmEvent (e); } public void OnEvent(TmSinglePhaseCommitEvent e) { TraceTmEvent(e); } public void OnEvent(TmCommitEvent e) { TraceTmEvent (e); } public void OnEvent(TmRollbackEvent e) { TraceTmEvent (e); } public void OnEvent(TmParticipantForgetEvent e) { TraceTmEvent (e); } public void OnEvent(TmRejoinEvent e) { TraceTmEvent (e); } public void OnEvent(TmReplayEvent e) { TraceTmEvent (e); } public void OnEvent(TmCoordinatorForgetEvent e) { TraceTmEvent (e); } public void OnEvent(TmAsyncRollbackEvent e) { TraceGenericEvent (e); } public void OnEvent(TimerCoordinatorEvent e) { DebugTrace.TxTrace ( TraceLevel.Info, e.Enlistment.EnlistmentId, "{0} for coordinator at {1}", e, Ports.TryGetAddress (e.Coordinator.CoordinatorProxy) ); } public void OnEvent(TimerParticipantEvent e) { DebugTrace.TxTrace ( TraceLevel.Info, e.Enlistment.EnlistmentId, "{0} for {1} participant at {2}", e, e.Participant.ControlProtocol, Ports.TryGetAddress (e.Participant.ParticipantProxy) ); } public void OnEvent(InternalEnlistSubordinateTransactionEvent e) { TraceGenericEvent(e); } public void OnEvent(TransactionContextEnlistTransactionEvent e) { TraceGenericEvent(e); } public void OnEvent(TransactionContextCreatedEvent e) { TraceGenericEvent(e); } public void OnEvent(TransactionContextTransactionDoneEvent e) { TraceGenericEvent(e); } } } // 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
- FormClosedEvent.cs
- DotExpr.cs
- CollectionView.cs
- RequestCacheEntry.cs
- GridViewEditEventArgs.cs
- PeerOutputChannel.cs
- Model3DGroup.cs
- Multiply.cs
- ListBoxItemAutomationPeer.cs
- MemberInfoSerializationHolder.cs
- BinaryObjectWriter.cs
- MetadataSerializer.cs
- LayoutEditorPart.cs
- AdPostCacheSubstitution.cs
- SystemTcpConnection.cs
- ForwardPositionQuery.cs
- DBSchemaTable.cs
- TabControl.cs
- Number.cs
- MulticastDelegate.cs
- MachineKeySection.cs
- PermissionListSet.cs
- COM2ComponentEditor.cs
- TextInfo.cs
- SafeEventLogWriteHandle.cs
- RightsManagementEncryptionTransform.cs
- Model3DGroup.cs
- DrawToolTipEventArgs.cs
- shaperfactoryquerycacheentry.cs
- ClassicBorderDecorator.cs
- ReceiveSecurityHeaderEntry.cs
- SafeBitVector32.cs
- ZipIOModeEnforcingStream.cs
- MenuAdapter.cs
- SqlBuffer.cs
- CharStorage.cs
- XamlSerializationHelper.cs
- ISCIIEncoding.cs
- ToolStripDropDownItem.cs
- CreateUserErrorEventArgs.cs
- MediaSystem.cs
- GradientStop.cs
- COM2PropertyPageUITypeConverter.cs
- TreeViewAutomationPeer.cs
- XpsSerializationManagerAsync.cs
- MenuItem.cs
- Publisher.cs
- AggregateNode.cs
- XmlnsCache.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- XPathPatternParser.cs
- WindowsSolidBrush.cs
- Border.cs
- SecurityContextSecurityToken.cs
- EncryptedType.cs
- RelationshipFixer.cs
- AutomationPatternInfo.cs
- SwitchElementsCollection.cs
- EntityAdapter.cs
- SqlRemoveConstantOrderBy.cs
- UIElement3D.cs
- CmsUtils.cs
- MaskedTextProvider.cs
- EntityCommandDefinition.cs
- RenderDataDrawingContext.cs
- MemberAccessException.cs
- WebPartCollection.cs
- XmlTextWriter.cs
- listitem.cs
- PersonalizationState.cs
- DataViewSetting.cs
- NameNode.cs
- CodeSnippetExpression.cs
- ControlBuilderAttribute.cs
- NavigationPropertySingletonExpression.cs
- PageBuildProvider.cs
- ObjectAssociationEndMapping.cs
- TraceContext.cs
- XPathNodeInfoAtom.cs
- PrinterResolution.cs
- Reference.cs
- mongolianshape.cs
- BitSet.cs
- PenLineCapValidation.cs
- ContextMenuStripGroupCollection.cs
- AdornerLayer.cs
- DataObject.cs
- PageParser.cs
- Token.cs
- XamlDebuggerXmlReader.cs
- PreviewPrintController.cs
- LoadRetryHandler.cs
- FontInfo.cs
- XmlQualifiedName.cs
- ParserStreamGeometryContext.cs
- ListParagraph.cs
- DBDataPermission.cs
- TemplateField.cs
- ClonableStack.cs
- DriveInfo.cs