Example #1
0
 public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
 {
     // Redis < 2.8 doesn't easily support key expiry notifications.
     // As of Redis 2.8, keyspace notifications (http://redis.io/topics/notifications)
     // can be used. Therefore, if you'd like to support the expiry
     // callback and are using Redis 2.8, you can inherit from this
     // class and implement it.
     return(false);
 }
 /// <summary>
 /// Sets the reference for the ExpireCallback delegate if setting is enabled.
 /// </summary>
 /// <param name="expireCallback"></param>
 /// <returns><c>true</c> if <see cref="enableExpireCallback"/> is <c>true</c>; otherwise, <c>false</c>.</returns>
 public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
 {
     if (this.enableExpireCallback)
     {
         this.expireCallback = expireCallback;
         return(true);
     }
     return(false);
 }
Example #3
0
        public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
        {
            if (Initializer.Is64Bit)
            {
                this._expireCallback = expireCallback;
            }

            return(true);
        }
        public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
        {
            LogUtils.WriteInfo("------------------ SetItemExpireCallback 1 ------------------");

            LogUtils.WriteInfo(expireCallback);

            LogUtils.WriteInfo("------------------ SetItemExpireCallback 2 ------------------\r\n");

            return(true);
        }
        /// <summary>
        /// SessionStateProviderBase.SetItemExpireCallback
        /// </summary>
        public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
        {
            // Accept and store callback if session expire callback is enabled. If not, return false in order to inform SessionStateModule
            // the session expire callback is not supported.
            if (!m_enableExpireCallback)
            {
                return(false);
            }

            m_expireCallback = expireCallback;
            return(true);
        }
        public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
        {
            var client = GetClient();

            var eventDelegate = (MulticastDelegate)client.GetType().GetField("OnRemoveByHandle", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(client);

            if (eventDelegate == null)
            {
                client.OnRemoveByHandle += GetExprireHandler(expireCallback);
            }

            return(true);
        }
Example #7
0
        public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
        {
            // 0 remote calls
            #region Access Log
#if TRACE
            {
                Handler.LogHandler.Tracking("Access Method: " + this.GetType().ToString() + "->" + ((object)MethodBase.GetCurrentMethod()).ToString() + " ;");
            }
#endif
            #endregion Access Log

            SessionExpired += expireCallback;
            return(true);
        }
 public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
 {
     return false;
 }
 public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
 {
     _expireCallBack = expireCallback;
     return true;
 }
 /// <summary>
 /// SessionStateProviderBase.SetItemExpireCallback メソッド
 /// http://msdn.microsoft.com/ja-jp/library/system.web.sessionstate.sessionstatestoreproviderbase.setitemexpirecallback.aspx
 /// Global.asax ファイルに定義されている Session_OnEnd イベント
 /// の SessionStateItemExpireCallback デリゲートへの参照を設定。
 /// </summary>
 /// <param name="expireCallback">
 /// SessionStateItemExpireCallback デリゲート
 /// </param>
 /// <returns>
 /// SessionStateStoreProviderが Session_OnEnd イベントの
 /// 呼び出しをサポートする場合は true。それ以外の場合は false。
 /// </returns>
 public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
 {
     // Session_OnEnd イベントの呼び出しをサポートしない。
     return(false);
 }
 /// <summary>
 /// This method sets up the event handler for the Session.OnEnd event. When the event handler is 
 ///     successfully attached, this method returns true. This method currently always returns false
 ///     because OnEnd is not supported in RedisSessionProvider v1. A future implementation may use
 ///     Redis Channels to implement this capability, but aside from that there is no way to 
 ///     generically communicate key-expirations back to the C# layer, which is where the 
 ///     expireCallback would be called.
 /// </summary>
 /// <param name="expireCallback">The callback function to execute when a Session expires</param>
 /// <returns>A bool indicating whether or not the expire callback was registered</returns>
 public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
 {
     // we do not accept callback methods on session expiration for now
     return false;
 }
Example #12
0
 public abstract virtual bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
 {
 }
 public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
 {
     _expireCallback = expireCallback;
     return(true);
 }
 /// <summary>
 /// Sets a reference to the <see cref="T:System.Web.SessionState.SessionStateItemExpireCallback" /> delegate for the Session_OnEnd event defined in the Global.asax file.
 /// </summary>
 /// <param name="expireCallback">The <see cref="T:System.Web.SessionState.SessionStateItemExpireCallback" />  delegate for the Session_OnEnd event defined in the Global.asax file.</param>
 /// <returns>
 /// true if the session-state store provider supports calling the Session_OnEnd event; otherwise, false.
 /// </returns>
 public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
 {
     // The Session_End event is only suported by the InProc session manager
     return false;
 }
 public abstract virtual bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
 {
 }
 public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
 {
     counters.IncrementTotalOperPc();
     return(false);
 }
Example #17
0
 public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
 {
     return(true);            //we call session.invalidate so our session listener will call Session_OnEnd
 }
 public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
 {
     _log.Trace("SetItemExpireCallback called.");
     return(false);
 }
 public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
 {
     //We don't receive notifications when cache items expire, so we can't support Session_OnEnd.
     return false;
 }
 /// <summary>
 /// Sets a reference to the <see cref="T:System.Web.SessionState.SessionStateItemExpireCallback"></see> delegate for the Session_OnEnd event defined in the Global.asax file.
 /// </summary>
 /// <param name="expireCallback">The <see cref="T:System.Web.SessionState.SessionStateItemExpireCallback"></see>  delegate for the Session_OnEnd event defined in the Global.asax file.</param>
 /// <returns>
 /// true if the session-state store provider supports calling the Session_OnEnd event; otherwise, false.
 /// </returns>
 public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
 {
     throw new Exception("The method or operation is not implemented.");
 }
 /// <summary>
 /// SessionStateProviderBase.SetItemExpireCallback メソッド
 /// http://msdn.microsoft.com/ja-jp/library/system.web.sessionstate.sessionstatestoreproviderbase.setitemexpirecallback.aspx
 /// Global.asax ファイルに定義されている Session_OnEnd イベント
 /// の SessionStateItemExpireCallback デリゲートへの参照を設定。
 /// </summary>
 /// <param name="expireCallback">
 /// SessionStateItemExpireCallback デリゲート
 /// </param>
 /// <returns>
 /// SessionStateStoreProviderが Session_OnEnd イベントの
 /// 呼び出しをサポートする場合は true。それ以外の場合は false。
 /// </returns>
 public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
 {
     // Session_OnEnd イベントの呼び出しをサポートしない。
     return false;
 }
 public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
 {
     throw new NotImplementedException();
 }
Example #23
0
    } // End of the CreateNewStoreData method

    #endregion

    #region Update methods

    /// <summary>
    /// Set the callback for session expiration
    /// </summary>
    public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
    {
        return false;

    } // End of the SetItemExpireCallback method
Example #24
0
        /// <summary>
        /// 指示Provider是否支持Session_OnEnd事件
        /// </summary>
        /// <param name="expireCallback"> Session_OnEnd 事件的委托</param>
        /// <returns></returns>
        public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
        {
            Debug.WriteLine("SetItemExpireCallback");

            return(false);
        }
		public override bool SetItemExpireCallback (SessionStateItemExpireCallback expireCallback) {
			return true; //we call session.invalidate so our session listener will call Session_OnEnd
		}
Example #26
0
 public virtual bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
 {
     return(false);
 }
 private EventHandler <CacheManager.Core.Internal.CacheItemRemovedEventArgs> GetExprireHandler(SessionStateItemExpireCallback expireCallback)
 {
     return((sender, args) =>
     {
         SessionState state = null;
         SessionStateStoreData result = null;
         SessionState.TryParse(args.Value as string, out state);
         result = new SessionStateStoreData(state.Items, null, state.Timeout);
         expireCallback.Invoke(args.Key, result);
     });
 }
 /// <summary>
 /// This method sets up the event handler for the Session.OnEnd event. When the event handler is
 ///     successfully attached, this method returns true. This method currently always returns false
 ///     because OnEnd is not supported in RedisSessionProvider v1. A future implementation may use
 ///     Redis Channels to implement this capability, but aside from that there is no way to
 ///     generically communicate key-expirations back to the C# layer, which is where the
 ///     expireCallback would be called.
 /// </summary>
 /// <param name="expireCallback">The callback function to execute when a Session expires</param>
 /// <returns>A bool indicating whether or not the expire callback was registered</returns>
 public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
 {
     // we do not accept callback methods on session expiration for now
     return(false);
 }
Example #29
0
 public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
 {
     //We don't receive notifications when cache items expire, so we can't support Session_OnEnd.
     return(false);
 }
 /// <summary>
 /// This method sets the reference for the ExpireCallback delegate if setting is enabled.
 /// </summary>
 /// <param name="expireCallback"></param>
 /// <returns>false </returns>
 public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
 {
   if (this.enableExpireCallback)
   {
     this.expireCallback = expireCallback;
     return true;
   }
   return false;
 }
 public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
 {
     return(_store.SetItemExpireCallback(expireCallback));
 }
Example #32
0
 public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
 {
     throw new NotImplementedException();
 }
		/// <summary>
		/// Sets a reference to the <see cref="T:System.Web.SessionState.SessionStateItemExpireCallback"></see> delegate for the Session_OnEnd event defined in the Global.asax file.
		/// </summary>
		/// <param name="expireCallback">The <see cref="T:System.Web.SessionState.SessionStateItemExpireCallback"></see>  delegate for the Session_OnEnd event defined in the Global.asax file.</param>
		/// <returns>
		/// true if the session-state store provider supports calling the Session_OnEnd event; otherwise, false.
		/// </returns>
		public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
		{
			throw new Exception("The method or operation is not implemented.");
		}
 public abstract bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback);
        /// <inheritdoc />
        public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
        {
            Debug.WriteLine(nameof(SetItemExpireCallback));

            return(true);
        }
Example #36
0
 /// <summary>
 /// Sets a reference to the <see cref="T:System.Web.SessionState.SessionStateItemExpireCallback" />
 /// delegate for the Session_OnEnd event defined in the Global.asax file.
 /// </summary>
 /// <param name="expireCallback">The <see cref="T:System.Web.SessionState.SessionStateItemExpireCallback" />
 /// delegate for the Session_OnEnd event defined in the Global.asax file.</param>
 /// <returns>
 /// true if the session-state store provider supports calling the Session_OnEnd event; otherwise, false.
 /// </returns>
 public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
 {
     // Expiration events not supported for now.
     return(false);
 }
 public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
 {
     // Redis < 2.8 doesn't easily support key expiry notifications.
     // As of Redis 2.8, keyspace notifications (http://redis.io/topics/notifications)
     // can be used. Therefore, if you'd like to support the expiry
     // callback and are using Redis 2.8, you can inherit from this
     // class and implement it.
     return false;
 }
 public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
 {
     // This provider doesn't support expiration callbacks
     // so simply return false here
     return false;
 }
 // Called by SessionStateModule to notify the provider that Session_End is defined
 // in global.asax, and so when an item expires, it should call the expireCallback
 // If the provider does not support session expiry, it should return false.
 public abstract bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback);
Example #40
0
 public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
 {
     // This provider doesn't support expiration callbacks
     // so simply return false here
     return(false);
 }
        /// <summary>
        /// SessionStateProviderBase.SetItemExpireCallback
        /// </summary>
        public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
        {
            // Accept and store callback if session expire callback is enabled. If not, return false in order to inform SessionStateModule
            // the session expire callback is not supported.
            if (!m_enableExpireCallback)
                return false;

            m_expireCallback = expireCallback;
            return true;
        }
Example #42
0
 public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
 {
     return(false);
 }
Example #43
0
 public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
 {
     // 这里不主动触发 【Session过期】 回调。
     return(true);
 }