コード例 #1
0
 internal void RemovedCallback(string key, object value, CacheItemRemovedReason callbackReason)
 {
     if (callbackReason == CacheItemRemovedReason.Expired)
     {
         lock (this.SyncRoot) {
             if (_sessions.Contains(key))
             {
                 try {
                     ISession session = GetSession(key);
                     if (session != null)
                     {
                         if (log.IsDebugEnabled)
                         {
                             log.Debug(__Res.GetString(__Res.SessionManager_CacheExpired, session.Id));
                         }
                         _TimeoutContext context = new _TimeoutContext(session);
                         FluorineWebSafeCallContext.SetData(FluorineContext.FluorineContextKey, context);
                         RemoveSession(session);
                         session.Timeout();
                         FluorineWebSafeCallContext.FreeNamedDataSlot(FluorineContext.FluorineContextKey);
                     }
                 } catch (Exception ex) {
                     if (log.IsErrorEnabled)
                     {
                         log.Error(__Res.GetString(__Res.SessionManager_CacheExpired, key), ex);
                     }
                 }
             }
         }
     }
 }
コード例 #2
0
ファイル: SessionManager.cs プロジェクト: GodLesZ/svn-dump
		internal void RemovedCallback(string key, object value, CacheItemRemovedReason callbackReason) {
			if (callbackReason == CacheItemRemovedReason.Expired) {
				lock (this.SyncRoot) {
					if (_sessions.Contains(key)) {
						try {
							ISession session = GetSession(key);
							if (session != null) {
								if (log.IsDebugEnabled)
									log.Debug(__Res.GetString(__Res.SessionManager_CacheExpired, session.Id));
								_TimeoutContext context = new _TimeoutContext(session);
								FluorineWebSafeCallContext.SetData(FluorineContext.FluorineContextKey, context);
								RemoveSession(session);
								session.Timeout();
								FluorineWebSafeCallContext.FreeNamedDataSlot(FluorineContext.FluorineContextKey);
							}
						} catch (Exception ex) {
							if (log.IsErrorEnabled)
								log.Error(__Res.GetString(__Res.SessionManager_CacheExpired, key), ex);
						}
					}
				}
			}
		}
コード例 #3
0
ファイル: ClientManager.cs プロジェクト: GodLesZ/svn-dump
		internal void RemovedCallback(string key, object value, CacheItemRemovedReason callbackReason) {
			if (callbackReason == CacheItemRemovedReason.Expired) {
				lock (this.SyncRoot) {
					if (_clients.Contains(key)) {
						try {
							IClient client = LookupClient(key);
							if (client != null) {
								if (log.IsDebugEnabled)
									log.Debug(__Res.GetString(__Res.ClientManager_CacheExpired, client.Id));

								_TimeoutContext context = new _TimeoutContext(client);
								FluorineWebSafeCallContext.SetData(FluorineContext.FluorineContextKey, context);
								client.Timeout();
								RemoveSubscriber(client);
								FluorineWebSafeCallContext.FreeNamedDataSlot(FluorineContext.FluorineContextKey);
							}
						} catch (Exception ex) {
							if (log.IsErrorEnabled)
								log.Error(__Res.GetString(__Res.ClientManager_CacheExpired, key), ex);
						}
					}
				}
			}
		}