private void OnSendRegisterComplete(CoordinatorEnlistment coordinator, ControlProtocol protocol, IAsyncResult ar)
 {
     SynchronizationEvent event2;
     EndpointAddress to = null;
     try
     {
         RegisterResponse response = coordinator.RegistrationProxy.EndSendRegister(ar);
         to = response.CoordinatorProtocolService;
         TwoPhaseCommitCoordinatorProxy proxy = this.state.TryCreateTwoPhaseCommitCoordinatorProxy(to);
         if (proxy == null)
         {
             if (RegistrationCoordinatorResponseInvalidMetadataRecord.ShouldTrace)
             {
                 RegistrationCoordinatorResponseInvalidMetadataRecord.Trace(coordinator.EnlistmentId, coordinator.SuperiorContext, protocol, to, null, this.state.ProtocolVersion);
             }
             event2 = new MsgRegistrationCoordinatorSendFailureEvent(coordinator);
         }
         else
         {
             try
             {
                 if (protocol == ControlProtocol.Durable2PC)
                 {
                     event2 = new MsgRegisterDurableResponseEvent(coordinator, response, proxy);
                 }
                 else
                 {
                     VolatileCoordinatorEnlistment asyncState = (VolatileCoordinatorEnlistment) ar.AsyncState;
                     event2 = new MsgRegisterVolatileResponseEvent(asyncState, response, proxy);
                 }
             }
             finally
             {
                 proxy.Release();
             }
         }
     }
     catch (WsatFaultException exception)
     {
         Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception, TraceEventType.Warning);
         event2 = new MsgRegistrationCoordinatorFaultEvent(coordinator, protocol, exception.Fault);
         if (RegistrationCoordinatorFaultedRecord.ShouldTrace)
         {
             RegistrationCoordinatorFaultedRecord.Trace(coordinator.EnlistmentId, coordinator.SuperiorContext, protocol, exception.Fault);
         }
     }
     catch (WsatMessagingException exception2)
     {
         Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception2, TraceEventType.Warning);
         this.state.Perf.MessageSendFailureCountPerInterval.Increment();
         if (RegistrationCoordinatorFailedRecord.ShouldTrace)
         {
             RegistrationCoordinatorFailedRecord.Trace(coordinator.EnlistmentId, coordinator.SuperiorContext, protocol, exception2);
         }
         DebugTrace.TraceSendFailure(coordinator.EnlistmentId, exception2);
         event2 = new MsgRegistrationCoordinatorSendFailureEvent(coordinator);
     }
     coordinator.StateMachine.Enqueue(event2);
 }
示例#2
0
 public virtual void OnEvent(MsgRegistrationCoordinatorSendFailureEvent e)
 {
     if ((this.state.ProtocolVersion == ProtocolVersion.Version10) && (e.Coordinator.ContextManager != null))
     {
         Fault fault = CoordinatorRegistrationFailedFault.CreateFault(null);
         e.Coordinator.ContextManager.Fault = fault;
     }
     this.InvalidSendMessageFailureEvent(e, e.Coordinator);
 }
 public virtual void OnEvent(MsgRegistrationCoordinatorSendFailureEvent e)
 {
     if ((this.state.ProtocolVersion == ProtocolVersion.Version10) && (e.Coordinator.ContextManager != null))
     {
         Fault fault = CoordinatorRegistrationFailedFault.CreateFault(null);
         e.Coordinator.ContextManager.Fault = fault;
     }
     this.InvalidSendMessageFailureEvent(e, e.Coordinator);
 }
 public void OnEvent(MsgRegistrationCoordinatorSendFailureEvent e)
 {
     this.TraceGenericEvent(e);
 }