// Token: 0x06000EA2 RID: 3746 RVA: 0x00038194 File Offset: 0x00036394 internal void Clear() { ExTraceGlobals.NotificationsCallTracer.TraceDebug((long)this.GetHashCode(), "[RowNotificationHandlerCache::Clear] disposing all row notification handlers"); try { OwaDiagnostics.SendWatsonReportsForGrayExceptions(delegate() { if (this.handlerCache == null) { throw new OwaInvalidOperationException("this.handlerCache may not be null"); } if (this.channelIdCache == null) { throw new OwaInvalidOperationException("this.channelIdCache may not be null"); } foreach (string key in this.handlerCache.Keys) { RowNotificationHandler rowNotificationHandler = this.handlerCache[key]; ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "[RowNotificationHandlerCache::Clear] Disposing handler for SubscriptionId: {0}", rowNotificationHandler.SubscriptionId); rowNotificationHandler.Dispose(); } this.handlerCache = new Dictionary <string, RowNotificationHandler>(); this.channelIdCache = new Dictionary <string, List <string> >(); }); } catch (GrayException ex) { ExTraceGlobals.NotificationsCallTracer.TraceError <string>(0L, "MapiNotificationHandlerBase.Dispose Unable to dispose object. exception {0}", ex.Message); } }
// Token: 0x06000E9E RID: 3742 RVA: 0x00037D0C File Offset: 0x00035F0C internal void ReleaseHandler(string subscriptionId, string channelId) { if (subscriptionId == null) { throw new ArgumentNullException("subscriptionId"); } if (this.handlerCache == null) { throw new OwaInvalidOperationException("this.handlerCache may not be null"); } if (this.channelIdCache == null) { throw new OwaInvalidOperationException("this.channelIdCache may not be null"); } RowNotificationHandler rowNotificationHandler = null; if (this.handlerCache.TryGetValue(subscriptionId, out rowNotificationHandler)) { ExTraceGlobals.NotificationsCallTracer.TraceDebug((long)this.GetHashCode(), "[RowNotificationHandlerCache::ReleaseHandler] releasing handler for SubscriptionId: {0} ChannelId: {1} Old RefCount: {2} New RefCount: {3}", new object[] { rowNotificationHandler.SubscriptionId, channelId, rowNotificationHandler.RefCount, rowNotificationHandler.RefCount - 1 }); if (--rowNotificationHandler.RefCount == 0) { ExTraceGlobals.NotificationsCallTracer.TraceDebug <string, string>((long)this.GetHashCode(), "[RowNotificationHandlerCache::ReleaseHandler] Disposing handler for SubscriptionId: {0} ChannelId: {1}", subscriptionId, channelId); this.handlerCache.Remove(subscriptionId); if (!this.userContext.MailboxSessionLockedByCurrentThread()) { try { try { this.userContext.LockAndReconnectMailboxSession(3000); rowNotificationHandler.Dispose(); rowNotificationHandler = null; } catch (OwaLockTimeoutException) { ExTraceGlobals.NotificationsCallTracer.TraceDebug <string, string>((long)this.GetHashCode(), "[RowNotificationHandlerCache::ReleaseHandler] Disposing handler for SubscriptionId: {0} ChannelId: {1} Failed to acquire mbx lock", subscriptionId, channelId); } catch (StoragePermanentException ex) { ExTraceGlobals.UserContextTracer.TraceError <string>(0L, "[RowNotificationHandlerCache::ReleaseHandler]. Unable to dispose object. exception {0}", ex.Message); } catch (StorageTransientException ex2) { ExTraceGlobals.UserContextTracer.TraceError <string>(0L, "[RowNotificationHandlerCache::ReleaseHandler]. Unable to dispose object. exception {0}", ex2.Message); } goto IL_15C; } finally { this.userContext.UnlockAndDisconnectMailboxSession(); } } rowNotificationHandler.Dispose(); rowNotificationHandler = null; } } IL_15C: if (channelId == null) { ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "[RowNotificationHandlerCache::ReleaseHandler] Returning without updating channel id lookup cache for non-unique view handler for SubscriptionId: {0}. ChannelId is null.", subscriptionId); return; } this.RemoveSubscriptionIdFromChannelIdCache(subscriptionId, channelId); }