protected override void InternalDispose(bool disposing)
 {
     if (disposing)
     {
         if (this.periodicTimer != null)
         {
             this.periodicTimer.Dispose(true);
             lock (this.periodicTimerLock)
             {
                 this.periodicTimer = null;
             }
         }
         lock (this.notificationLock)
         {
             if (this.adNotificationCookie != null)
             {
                 ADOperationResult adoperationResult = ADNotificationAdapter.TryRunADOperation(delegate()
                 {
                     ADNotificationAdapter.UnregisterChangeNotification(this.adNotificationCookie);
                 }, 2);
                 if (!adoperationResult.Succeeded)
                 {
                     this.LogFailure(ADConfigurationLoader <ADConfigType, StateType> .FailureLocation.ADNotificationRegistration, adoperationResult.Exception);
                 }
                 this.adNotificationCookie = null;
             }
             this.hasUnregisteredNotification = true;
         }
     }
 }
Пример #2
0
 // Token: 0x06000D81 RID: 3457 RVA: 0x00059FAC File Offset: 0x000581AC
 private void UnregisterConfigurationChangeNotification()
 {
     if (this.owaCookie == null)
     {
         if (this.publicFolderTreeCookie == null)
         {
             return;
         }
     }
     try
     {
         Utilities.CreateADSystemConfigurationSessionScopedToFirstOrg(true, ConsistencyMode.IgnoreInvalid);
         if (this.owaCookie != null)
         {
             ADNotificationAdapter.UnregisterChangeNotification(this.owaCookie);
         }
         if (this.publicFolderTreeCookie != null)
         {
             ADNotificationAdapter.UnregisterChangeNotification(this.publicFolderTreeCookie);
         }
         if (this.publicFolderDatabaseCookie != null)
         {
             ADNotificationAdapter.UnregisterChangeNotification(this.publicFolderDatabaseCookie);
         }
     }
     catch (Exception ex)
     {
         OwaConfigurationManager.instance.LogConfigurationException(ClientsEventLogConstants.Tuple_UnregisterADNotifications, "Unable to unregister from change notifications. {0}", ex.Message);
     }
 }
Пример #3
0
 internal static void Terminate()
 {
     if (Configuration.exchangeRCANotificationCookie != null)
     {
         ADNotificationAdapter.UnregisterChangeNotification(Configuration.exchangeRCANotificationCookie);
         Configuration.exchangeRCANotificationCookie = null;
     }
 }
Пример #4
0
 private static void CurrentDomain_DomainUnload(object sender, EventArgs e)
 {
     if (HelpProvider.notificationRequestCookie != null)
     {
         ADNotificationAdapter.UnregisterChangeNotification(HelpProvider.notificationRequestCookie);
         HelpProvider.notificationRequestCookie = null;
     }
 }
Пример #5
0
 public override void UnregisterChangeNotification()
 {
     if (this.notificationCookie != null)
     {
         this.TryRunADOperation(delegate
         {
             ADNotificationAdapter.UnregisterChangeNotification(this.notificationCookie);
         }, false);
     }
 }
Пример #6
0
        protected override ADNotificationRequestCookie Register(IConfigurationSession session)
        {
            ADNotificationRequestCookie request = ADNotificationAdapter.RegisterChangeNotification <PolicyTipMessageConfig>(PerTenantPolicyNudgeRulesCollection.GetPolicyTipMessageConfigsContainerId(session), new ADNotificationCallback(base.ChangeCallback), session);
            ADNotificationRequestCookie result;

            try
            {
                result = ADNotificationAdapter.RegisterChangeNotification <TransportRule>(PerTenantPolicyNudgeRulesCollection.GetPolicyNudgeRuleContainerId(session), new ADNotificationCallback(base.ChangeCallback), session);
            }
            catch (Exception ex)
            {
                ADNotificationAdapter.UnregisterChangeNotification(request);
                throw ex;
            }
            return(result);
        }
 // Token: 0x0600002C RID: 44 RVA: 0x00003688 File Offset: 0x00001888
 internal override void OnStop()
 {
     lock (ModeratedDLApplication.SyncRoot)
     {
         ModeratedDLApplication.refCount--;
         if (ModeratedDLApplication.refCount == 0)
         {
             if (this.serverConfigNotificationCookie != null)
             {
                 ADNotificationAdapter.UnregisterChangeNotification(this.serverConfigNotificationCookie);
                 this.serverConfigNotificationCookie = null;
             }
             MessageTrackingLog.Stop();
         }
     }
     base.OnStop();
 }
Пример #8
0
 public static void Stop()
 {
     if (RmsClientManagerLog.notificationCookie != null)
     {
         try
         {
             ADNotificationAdapter.UnregisterChangeNotification(RmsClientManagerLog.notificationCookie);
             if (RmsClientManagerLog.rmsLog != null)
             {
                 RmsClientManagerLog.rmsLog.Close();
             }
         }
         catch (ObjectDisposedException)
         {
         }
         RmsClientManagerLog.notificationCookie = null;
     }
 }
Пример #9
0
        // Token: 0x06000002 RID: 2 RVA: 0x000020F4 File Offset: 0x000002F4
        public override void Work()
        {
            Servicelet.Tracer.TraceDebug((long)this.GetHashCode(), "Work(): Entering");
            this.session = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(ConsistencyMode.PartiallyConsistent, ADSessionSettings.FromRootOrgScopeSet(), 104, "Work", "f:\\15.00.1497\\sources\\dev\\Management\\src\\ServiceHost\\Servicelets\\CertificateDeployment\\Program\\CertificateDeploymentServicelet.cs");
            try
            {
                this.localServer = this.session.FindLocalServer();
            }
            catch (LocalServerNotFoundException ex)
            {
                Servicelet.Tracer.TraceError <LocalServerNotFoundException>((long)this.GetHashCode(), "LocalServerNotFound: {0}", ex);
                this.eventLogger.LogEvent(MSExchangeCertificateDeploymentEventLogConstants.Tuple_PermanentException, null, new object[]
                {
                    ex
                });
                return;
            }
            ADNotificationRequestCookie adnotificationRequestCookie  = null;
            ADNotificationRequestCookie adnotificationRequestCookie2 = null;

            try
            {
                this.distributionTimer       = new GuardedTimer(new TimerCallback(this.DoScheduledWork), null, Servicelet.NotificationDelay, Servicelet.ReloadDelay);
                adnotificationRequestCookie  = this.InstallConfigMonitor <FederationTrust>("Federation Trusts");
                adnotificationRequestCookie2 = this.InstallConfigMonitor <AuthConfig>(AuthConfig.ContainerName);
                base.StopEvent.WaitOne();
                Servicelet.Tracer.TraceDebug((long)this.GetHashCode(), "Work(): Exiting");
            }
            finally
            {
                if (adnotificationRequestCookie != null)
                {
                    ADNotificationAdapter.UnregisterChangeNotification(adnotificationRequestCookie);
                }
                if (adnotificationRequestCookie2 != null)
                {
                    ADNotificationAdapter.UnregisterChangeNotification(adnotificationRequestCookie2);
                }
                if (this.distributionTimer != null)
                {
                    this.distributionTimer.Dispose(false);
                }
            }
        }
Пример #10
0
 public void Unregister()
 {
     try
     {
         ADNotificationAdapter.UnregisterChangeNotification(this.adNotificationRequestCookie);
     }
     catch (DataSourceOperationException innerException)
     {
         ServiceDiscoveryPermanentException ex = new ServiceDiscoveryPermanentException(ServerStrings.ExFailedToUnregisterExchangeTopologyNotification, innerException);
         ExTraceGlobals.ServiceDiscoveryTracer.TraceError <ServiceDiscoveryPermanentException>(0L, "RegisteredExchangeTopologyNotification::Unregister. Failed to unregister. Throwing exception: {0}.", ex);
         throw ex;
     }
     catch (ADTransientException innerException2)
     {
         ServiceDiscoveryTransientException ex2 = new ServiceDiscoveryTransientException(ServerStrings.ExFailedToUnregisterExchangeTopologyNotification, innerException2);
         ExTraceGlobals.ServiceDiscoveryTracer.TraceError <ServiceDiscoveryTransientException>(0L, "RegisteredExchangeTopologyNotification::Unregister. Failed to unregister. Throwing exception: {0}.", ex2);
         throw ex2;
     }
 }
Пример #11
0
 private void UnregisterADNotifications()
 {
     if (DiagnosticsAggregationServicelet.serverConfigNotificationCookie != null)
     {
         ADNotificationAdapter.TryRunADOperation(delegate()
         {
             ADNotificationAdapter.UnregisterChangeNotification(DiagnosticsAggregationServicelet.serverConfigNotificationCookie);
         }, 0);
         DiagnosticsAggregationServicelet.serverConfigNotificationCookie = null;
     }
     if (DiagnosticsAggregationServicelet.transportSettingsNotificationCookie != null)
     {
         ADNotificationAdapter.TryRunADOperation(delegate()
         {
             ADNotificationAdapter.UnregisterChangeNotification(DiagnosticsAggregationServicelet.transportSettingsNotificationCookie);
         }, 0);
         DiagnosticsAggregationServicelet.transportSettingsNotificationCookie = null;
     }
 }
Пример #12
0
 public void UnregisterChangeNotification(ADNotificationRequestCookie cookie)
 {
     ADNotificationAdapter.UnregisterChangeNotification(cookie);
 }