Esempio n. 1
0
 private void StopListeners()
 {
     DebugTrace.TraceEnter(this, "StopListeners");
     if (this.twoPhaseCommitCoordinatorListener != null)
     {
         this.twoPhaseCommitCoordinatorListener.Stop();
         this.twoPhaseCommitCoordinatorListener = null;
     }
     if (this.twoPhaseCommitParticipantListener != null)
     {
         this.twoPhaseCommitParticipantListener.Stop();
         this.twoPhaseCommitParticipantListener = null;
     }
     if (this.completionCoordinatorListener != null)
     {
         this.completionCoordinatorListener.Stop();
         this.completionCoordinatorListener = null;
     }
     if (this.registrationCoordinatorListener != null)
     {
         this.registrationCoordinatorListener.Stop();
         this.registrationCoordinatorListener = null;
     }
     if (this.activationCoordinatorListener != null)
     {
         this.activationCoordinatorListener.Stop();
         this.activationCoordinatorListener = null;
     }
     if (this.coordination != null)
     {
         this.coordination.Cleanup();
         this.coordination = null;
     }
     DebugTrace.TraceLeave(this, "StopListeners");
 }
Esempio n. 2
0
 public void RecoveryBeginning()
 {
     DebugTrace.TraceEnter(this, "RecoveryBeginning");
     if (this.config.NetworkEndpointsEnabled)
     {
         try
         {
             this.coordination = new CoordinationService(this.config.PortConfiguration, this.protocolVersion);
             this.activationCoordinatorListener     = this.coordination.Add(this.activationCoordinator);
             this.registrationCoordinatorListener   = this.coordination.Add(this.registrationCoordinator);
             this.completionCoordinatorListener     = this.coordination.Add(this.completionCoordinator);
             this.twoPhaseCommitCoordinatorListener = this.coordination.Add(this.twoPhaseCommitCoordinator);
             this.twoPhaseCommitParticipantListener = this.coordination.Add(this.twoPhaseCommitParticipant);
         }
         catch (MessagingInitializationException exception)
         {
             if (DebugTrace.Error)
             {
                 DebugTrace.Trace(TraceLevel.Error, "Error initializing CoordinationService: {0}", exception);
             }
             this.CleanupOnFailure();
             throw Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new PluggableProtocolException(exception.Message, exception));
         }
         catch (Exception exception2)
         {
             if (DebugTrace.Error)
             {
                 DebugTrace.Trace(TraceLevel.Error, "Unknown exception initializing CoordinationService: {0}", exception2);
             }
             this.CleanupOnFailure();
             throw;
         }
     }
     DebugTrace.TraceLeave(this, "RecoveryBeginning");
 }
        public ICoordinationListener Add(IRegistrationCoordinator serviceInstance)
        {
            DebugTrace.TraceEnter("CoordinationService.Add (IRegistrationCoordinator)");
            this.AssertProtocolServiceMode();
            IWSRegistrationCoordinator dispatcher = RegistrationCoordinatorDispatcher.Instance(this, serviceInstance);
            ICoordinationListener      listener   = this.CreateService(dispatcher, dispatcher.ContractType, BindingStrings.RegistrationCoordinatorSuffix(this.protocolVersion));

            DebugTrace.TraceLeave("CoordinationService.Add (IRegistrationCoordinator)");
            return(listener);
        }
        public ICoordinationListener Add(ICompletionParticipant serviceInstance)
        {
            DebugTrace.TraceEnter("CoordinationService.Add (ICompletionParticipant)");
            this.AssertProtocolServiceMode();
            IWSCompletionParticipant dispatcher = CompletionParticipantDispatcher.Instance(this, serviceInstance);
            ICoordinationListener    listener   = this.CreateService(dispatcher, dispatcher.ContractType, BindingStrings.CompletionParticipantSuffix(this.protocolVersion));

            DebugTrace.TraceLeave("CoordinationService.Add (ICompletionParticipant)");
            return(listener);
        }
 private void StopListeners()
 {
     DebugTrace.TraceEnter(this, "StopListeners");
     if (this.twoPhaseCommitCoordinatorListener != null)
     {
         this.twoPhaseCommitCoordinatorListener.Stop();
         this.twoPhaseCommitCoordinatorListener = null;
     }
     if (this.twoPhaseCommitParticipantListener != null)
     {
         this.twoPhaseCommitParticipantListener.Stop();
         this.twoPhaseCommitParticipantListener = null;
     }
     if (this.completionCoordinatorListener != null)
     {
         this.completionCoordinatorListener.Stop();
         this.completionCoordinatorListener = null;
     }
     if (this.registrationCoordinatorListener != null)
     {
         this.registrationCoordinatorListener.Stop();
         this.registrationCoordinatorListener = null;
     }
     if (this.activationCoordinatorListener != null)
     {
         this.activationCoordinatorListener.Stop();
         this.activationCoordinatorListener = null;
     }
     if (this.coordination != null)
     {
         this.coordination.Cleanup();
         this.coordination = null;
     }
     DebugTrace.TraceLeave(this, "StopListeners");
 }
 public void RecoveryBeginning()
 {
     DebugTrace.TraceEnter(this, "RecoveryBeginning");
     if (this.config.NetworkEndpointsEnabled)
     {
         try
         {
             this.coordination = new CoordinationService(this.config.PortConfiguration, this.protocolVersion);
             this.activationCoordinatorListener = this.coordination.Add(this.activationCoordinator);
             this.registrationCoordinatorListener = this.coordination.Add(this.registrationCoordinator);
             this.completionCoordinatorListener = this.coordination.Add(this.completionCoordinator);
             this.twoPhaseCommitCoordinatorListener = this.coordination.Add(this.twoPhaseCommitCoordinator);
             this.twoPhaseCommitParticipantListener = this.coordination.Add(this.twoPhaseCommitParticipant);
         }
         catch (MessagingInitializationException exception)
         {
             if (DebugTrace.Error)
             {
                 DebugTrace.Trace(TraceLevel.Error, "Error initializing CoordinationService: {0}", exception);
             }
             this.CleanupOnFailure();
             throw Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new PluggableProtocolException(exception.Message, exception));
         }
         catch (Exception exception2)
         {
             if (DebugTrace.Error)
             {
                 DebugTrace.Trace(TraceLevel.Error, "Unknown exception initializing CoordinationService: {0}", exception2);
             }
             this.CleanupOnFailure();
             throw;
         }
     }
     DebugTrace.TraceLeave(this, "RecoveryBeginning");
 }