public void Rollback(Message message) { try { if (DebugTrace.Verbose) { DebugTrace.Trace(TraceLevel.Verbose, "Dispatching completion Rollback message"); if (DebugTrace.Pii) { DebugTrace.TracePii(TraceLevel.Verbose, "Sender is {0}", CoordinationServiceSecurity.GetSenderName(message)); } } RollbackMessage.ReadFrom(message, this.service.ProtocolVersion); this.dispatch.Rollback(message); } catch (CommunicationException exception) { Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception, TraceEventType.Warning); base.OnMessageException(message, exception); } catch (Exception exception2) { DebugTrace.Trace(TraceLevel.Error, "Unhandled exception {0} dispatching completion Rollback message: {1}", exception2.GetType().Name, exception2); Microsoft.Transactions.Bridge.DiagnosticUtility.InvokeFinalHandler(exception2); } }
public void Replay(Message message) { ProtocolVersionHelper.AssertProtocolVersion10(this.protocolVersion, typeof(TwoPhaseCommitCoordinatorDispatcher), "constr"); try { if (DebugTrace.Verbose) { DebugTrace.Trace(TraceLevel.Verbose, "Dispatching 2PC Replay message"); if (DebugTrace.Pii) { DebugTrace.TracePii(TraceLevel.Verbose, "Sender is {0}", CoordinationServiceSecurity.GetSenderName(message)); } } ReplayMessage.ReadFrom(message, this.protocolVersion); this.dispatch.Replay(message); } catch (CommunicationException exception) { Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception, TraceEventType.Warning); base.OnMessageException(message, exception); } catch (Exception exception2) { DebugTrace.Trace(TraceLevel.Error, "Unhandled exception {0} dispatching Replay message: {1}", exception2.GetType().Name, exception2); Microsoft.Transactions.Bridge.DiagnosticUtility.InvokeFinalHandler(exception2); } }
private void Fault(Message message) { try { MessageFault fault = MessageFault.CreateFault(message, 0x10000); if (DebugTrace.Verbose) { FaultCode baseFaultCode = Library.GetBaseFaultCode(fault); DebugTrace.Trace(TraceLevel.Verbose, "Dispatching participant completion fault {0}", (baseFaultCode == null) ? "unknown" : baseFaultCode.Name); if (DebugTrace.Pii) { DebugTrace.TracePii(TraceLevel.Verbose, "Sender is {0}", CoordinationServiceSecurity.GetSenderName(message)); } } this.dispatch.Fault(message, fault); } catch (CommunicationException exception) { Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception, TraceEventType.Warning); base.OnMessageException(message, exception); } catch (Exception exception2) { DebugTrace.Trace(TraceLevel.Error, "Unhandled exception {0} dispatching completion fault from participant: {1}", exception2.GetType().Name, exception2); Microsoft.Transactions.Bridge.DiagnosticUtility.InvokeFinalHandler(exception2); } }
public RegisterResponse EndSendRegister(IAsyncResult ar) { RegisterResponse response; try { Message message = base.EndSendRequest(ar, base.coordinationStrings.RegisterResponseAction); using (message) { if (DebugTrace.Verbose) { DebugTrace.Trace(TraceLevel.Verbose, "Dispatching RegisterResponse reply"); if (DebugTrace.Pii) { DebugTrace.TracePii(TraceLevel.Verbose, "Sender is {0}", CoordinationServiceSecurity.GetSenderName(message)); } } response = new RegisterResponse(message, base.protocolVersion); } } catch (CommunicationException exception) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new WsatReceiveFailureException(exception)); } return(response); }
public IAsyncResult BeginCreateCoordinationContext(Message message, AsyncCallback callback, object state) { if (DebugTrace.Verbose) { DebugTrace.Trace(TraceLevel.Verbose, "Dispatching CreateCoordinationContext request"); if (DebugTrace.Pii) { DebugTrace.TracePii(TraceLevel.Verbose, "Sender is {0}", CoordinationServiceSecurity.GetSenderName(message)); } } Microsoft.Transactions.Wsat.Messaging.RequestAsyncResult result = new Microsoft.Transactions.Wsat.Messaging.RequestAsyncResult(message, callback, state); try { this.dispatch.CreateCoordinationContext(message, result); } catch (InvalidMessageException exception) { Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception, TraceEventType.Warning); base.OnMessageException(result, message, exception, Faults.Version(this.service.ProtocolVersion).InvalidParameters); } catch (CommunicationException exception2) { Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception2, TraceEventType.Warning); base.OnMessageException(result, message, exception2, Faults.Version(this.service.ProtocolVersion).CreateContextDispatchFailed); } catch (Exception exception3) { DebugTrace.Trace(TraceLevel.Error, "Unhandled exception {0} dispatching CreateCoordinationContext message: {1}", exception3.GetType().Name, exception3); Microsoft.Transactions.Bridge.DiagnosticUtility.InvokeFinalHandler(exception3); } return(result); }
public RegisterResponse SendRegister(ref Register register) { if (DebugTrace.Verbose) { DebugTrace.Trace(TraceLevel.Verbose, "Sending Register to {0}", base.to.Uri); } Message message = this.CreateRegisterMessage(ref register); Message message2 = base.SendRequest(message, base.coordinationStrings.RegisterResponseAction); using (message2) { if (DebugTrace.Verbose) { DebugTrace.Trace(TraceLevel.Verbose, "Dispatching RegisterResponse reply"); if (DebugTrace.Pii) { DebugTrace.TracePii(TraceLevel.Verbose, "Sender is {0}", CoordinationServiceSecurity.GetSenderName(message2)); } } return(new RegisterResponse(message2, base.protocolVersion)); } }
public CreateCoordinationContextResponse SendCreateCoordinationContext(ref CreateCoordinationContext create) { if (DebugTrace.Verbose) { DebugTrace.Trace(TraceLevel.Verbose, "Sending CreateCoordinationContext to {0}", base.to.Uri); } Message message = this.CreateCreateCoordinationContextMessage(ref create); Message message2 = base.SendRequest(message, base.coordinationStrings.CreateCoordinationContextResponseAction); using (message2) { if (DebugTrace.Verbose) { DebugTrace.Trace(TraceLevel.Verbose, "Dispatching CreateCoordinationContextResponse reply"); if (DebugTrace.Pii) { DebugTrace.TracePii(TraceLevel.Verbose, "Sender is {0}", CoordinationServiceSecurity.GetSenderName(message2)); } } return(new CreateCoordinationContextResponse(message2, base.protocolVersion)); } }
private void TraceAccessCheckResult(bool result, MessageProperties messageProperties) { if (result) { if (DebugTrace.Info) { if (DebugTrace.Pii) { DebugTrace.TracePii(TraceLevel.Info, "Access granted to {0} by global ACL", CoordinationServiceSecurity.GetSenderName(messageProperties)); } else { DebugTrace.Trace(TraceLevel.Info, "Access granted by global ACL"); } } } else if (DebugTrace.Warning) { if (DebugTrace.Pii) { DebugTrace.TracePii(TraceLevel.Warning, "Access denied to {0} by global ACL", CoordinationServiceSecurity.GetSenderName(messageProperties)); } else { DebugTrace.Trace(TraceLevel.Warning, "Access denied by global ACL"); } } }