/// <summary>
 /// Removes the handler from the handler/factory dictionary and releases the handler.
 /// </summary>
 /// <param name="handler">the handler to be released</param>
 /// <param name="_handlerWithFactoryTable">a dictionary containing (<see cref="IHttpHandler"/>, <see cref="IHttpHandlerFactory"/>) entries.</param>
 protected void ReleaseHandler(IHttpHandler handler, IDictionary _handlerWithFactoryTable)
 {
     lock (_handlerWithFactoryTable.SyncRoot)
     {
         IHttpHandlerFactory factory = _handlerWithFactoryTable[handler] as IHttpHandlerFactory;
         if (factory != null)
         {
             _handlerWithFactoryTable.Remove(handler);
             factory.ReleaseHandler(handler);
         }
     }
 }
Пример #2
0
        public void ProcessRequest(HttpContext context)
        {
            IHttpHandlerFactory fact    = (IHttpHandlerFactory)Activator.CreateInstance(Type.GetType("System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"));
            IHttpHandler        handler = fact.GetHandler(context, context.Request.RequestType, context.Request.Path, context.Request.PhysicalApplicationPath);

            try
            {
                handler.ProcessRequest(context);
                context.Response.StatusCode = 200;
                context.ApplicationInstance.CompleteRequest();
            }
            finally
            {
                fact.ReleaseHandler(handler);
            }
        }
Пример #3
0
 /// <summary>
 /// Enables a factory to release an existing
 /// <see cref="System.Web.IHttpHandler"/> instance.
 /// </summary>
 /// <param name="handler">
 /// The <see cref="System.Web.IHttpHandler"/> object to release.
 /// </param>
 public override void ReleaseHandler(IHttpHandler handler)
 {
     _innerFactory.ReleaseHandler(handler);
 }
        public void ReleaseHandler(IHttpHandler handler)
        {
            IHttpHandlerFactory pageHandlerFactory = CreateFactory();

            pageHandlerFactory.ReleaseHandler(handler);
        }
 public void ReleaseHandler()
 {
     _originalFactory.ReleaseHandler(_originalHandler);
 }
Пример #6
0
 internal void ReleaseHandler()
 {
     _originalFactory.ReleaseHandler(_originalHandler);
 }
Пример #7
0
 internal void Recycle()
 {
     _factory.ReleaseHandler(_handler);
 }