* Page.cs: Set the cache's duration.
[mono.git] / mcs / class / System.Web / System.Web.UI / SimpleHandlerFactory.cs
1 //
2 // System.Web.UI.SimpleHandlerFactory
3 //
4 // Authors:
5 //      Gonzalo Paniagua Javier (gonzalo@ximian.com)
6 //
7 // (C) 2002,2003 Ximian, Inc (http://www.ximian.com)
8 //
9
10 using System.Web;
11
12 namespace System.Web.UI
13 {
14         class SimpleHandlerFactory : IHttpHandlerFactory
15         {
16                 public virtual IHttpHandler GetHandler (HttpContext context,
17                                                         string requestType,
18                                                         string virtualPath,
19                                                         string path)
20                 {
21                         Type type = WebHandlerParser.GetCompiledType (context, virtualPath, path);
22                         if (!(typeof (IHttpHandler).IsAssignableFrom (type)))
23                                 throw new HttpException ("Type does not implement IHttpHandler: " + type.FullName);
24
25                         return Activator.CreateInstance (type) as IHttpHandler;
26                 }
27
28                 public virtual void ReleaseHandler (IHttpHandler handler)
29                 {
30                 }
31         }
32 }
33