Esempio n. 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);
                     }
                 }
             }
         }
     }
 }
Esempio n. 2
0
        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);
                        }
                    }
                }
            }
        }
Esempio n. 3
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);
                 }
             }
         }
     }
 }
		public void RemovedCallback(string key, object value, CacheItemRemovedReason callbackReason) 
		{
			if( callbackReason == CacheItemRemovedReason.Expired )
			{
				lock(_objLock)
				{
					if( _subscribers.Contains(key) )
					{
						try
						{
							MessageClient messageClient = GetSubscriber(key);
                            if (messageClient != null)
                            {
                                if (log.IsDebugEnabled)
                                    log.Debug(__Res.GetString(__Res.SubscriptionManager_CacheExpired, messageClient.ClientId));
                                if (_messageDestination != null)
                                {
                                    //MessageBroker messageBroker = _messageDestination.Service.GetMessageBroker();
                                    _TimeoutContext context = new _TimeoutContext(messageClient);
                                    FluorineWebSafeCallContext.SetData(FluorineContext.FluorineContextKey, context);
                                    messageClient.Timeout();
                                    FluorineWebSafeCallContext.FreeNamedDataSlot(FluorineContext.FluorineContextKey);
                                }
                            }
						}
						catch(Exception ex)
						{
							if( log.IsErrorEnabled )
                                log.Error(__Res.GetString(__Res.SubscriptionManager_CacheExpired, string.Empty), ex);
						}
					}
				}
			}
		}