/// <summary>
        /// Applies the custom lease time behavior.
        /// </summary>        
        /// <remarks>
        /// This method is invoked by WCF runtime.
        /// </remarks>
        public void ApplyDispatchBehavior(ServiceDescription description, ServiceHostBase serviceHostBase)
        {
            CustomLifetimeLease customLease = new CustomLifetimeLease(timeout);

            foreach (ChannelDispatcherBase cdb in serviceHostBase.ChannelDispatchers)
            {
                ChannelDispatcher cd = cdb as ChannelDispatcher;

                if (cd != null)
                {
                    foreach (EndpointDispatcher ed in cd.Endpoints)
                    {
                        ed.DispatchRuntime.InstanceContextProvider = customLease;
                    }
                }
            }
        }
        /// <summary>
        /// Applies the custom lease time behavior.
        /// </summary>
        /// <remarks>
        /// This method is invoked by WCF runtime.
        /// </remarks>
        public void ApplyDispatchBehavior(ServiceDescription description, ServiceHostBase serviceHostBase)
        {
            CustomLifetimeLease customLease = new CustomLifetimeLease(timeout);

            foreach (ChannelDispatcherBase cdb in serviceHostBase.ChannelDispatchers)
            {
                ChannelDispatcher cd = cdb as ChannelDispatcher;

                if (cd != null)
                {
                    foreach (EndpointDispatcher ed in cd.Endpoints)
                    {
                        ed.DispatchRuntime.InstanceContextProvider = customLease;
                    }
                }
            }
        }