473,405 Members | 2,279 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Is an HttpHandler notified when it is released to the pool?

If an HttpHandler is implementing IsReusable = true, is the instance
notitifed when it is actually released to the pool? Of course, each instance
is released to the pool when ProcessRequest terminates. I'm working on a
different design pattern though. In my architecture, all of my handlers
derive from a base super-handler class and I'd like to implement certain
behavior in the super-handler class to occur at transaction completion time.
For a non-pooled object this would happen when the class is disposed, for a
pooled object this would happen when the object is released to the pool. How
can I determine when this latter event, release to the pool, happens?

Thanks for your advice.

- Joseph Geretz -
Sep 4 '08 #1
1 1272

"Joseph Geretz" <jg*****@nospam.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
If an HttpHandler is implementing IsReusable = true, is the instance
notitifed when it is actually released to the pool? Of course, each
instance is released to the pool when ProcessRequest terminates. I'm
working on a different design pattern though. In my architecture, all of
my handlers derive from a base super-handler class and I'd like to
implement certain behavior in the super-handler class to occur at
transaction completion time. For a non-pooled object this would happen
when the class is disposed, for a pooled object this would happen when the
object is released to the pool. How can I determine when this latter
event, release to the pool, happens?
I'm not sure what you mean by a 'non-pooled object' being disposed. Even if
your super class implements IDisposable what would call it?

Consider this approach:-

public abstract class SuperHandler : IHttpHandler
{

private HttpContext myContext;
public HttpContext Context { get { return myContext; } }

public HttpResponse Response { get { return myContext.Response; } }
public HttpRequest Request { get { return myContext.Request; } }

protected abstract void InnerProcess();

public void ProcessRequest(HttpContext context)
{
myContext = context;
InnerProcess();
// Code here for when request complete
myContext = null;
}

public virtual bool IsReusable { get { return false; } }
}

public class Test : SuperHandler
{
protected override void InnerProcess()
{
// Do stuff
}
}
--
Anthony Jones - MVP ASP/ASP.NET

Sep 5 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Earl Teigrob | last post by:
My company sells software and wants to provide downloadable product. Some of these downloads will be full CD's of over 550M I had everything working fine using Response.filewrite() but when we...
3
by: Jed | last post by:
I have written an HttpHandler which I invoke through an ashx page. The HttpHandler does various things to process the request, then it is supposed to redirect to a confirmation page. Everything...
4
by: Jeremy Lew | last post by:
When my HttpHandler is processing a request when installed on a particular 2003 Server machine, the Context.Session object is null. Any idea why this might be? My handler implements...
7
by: Adam | last post by:
Im trying to add an httphandler for all *.sgf file extensions. I have developed the handler, 1. installed it into the gac 2. added it to the machine.config: <httpHandlers> <add verb="*"...
8
by: bryan | last post by:
I've got a custom HttpHandler to process all requests for a given extension. It gets invoked OK, but if I try to do a Server.Transfer I get an HttpException. A Response.Redirect works, but I really...
3
by: Michael Schwarz | last post by:
Hi, I have a own HttpHandler running and configured like this in my web.config: <add verb="*" path="subfolder/*.ashx" type="Class,Assembly"/> Now, when turning cookieless Sessions on my...
44
by: Smokey Grindle | last post by:
I have a list box on my form, but I need to databind it to a data table that is a private member of the form's class... so I basically have Public Class MyForm priate m_MyTable as new datatable...
2
by: sareena | last post by:
There is a problem with accessing an ASP appln hosted on a dedicated Win '03 load balanced server running IIS 6.0 in worker process isolation mode. When the user types in the URl of the appln and...
5
by: Author | last post by:
I followed the example at http://support.microsoft.com/kb/308001/EN-US/ and created my own HttpHandler. Here is the code: using System.Web; namespace MyNameSpace { public class...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.