1 //------------------------------------------------------------------------------
2 // <copyright file="IHttpHandlerFactory.cs" company="Microsoft">
3 //     Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 //------------------------------------------------------------------------------
6 
7 /*
8  * Handler factory interface
9  */
10 namespace System.Web {
11 
12     using System.Security.Permissions;
13     /*
14      * Handler factory -- gets Handler by requestType,path,file
15      */
16 
17     /// <devdoc>
18     ///    <para>
19     ///       Defines the contract that factories must implement to dynamically
20     ///       create IHttpHandler instances.
21     ///    </para>
22     /// </devdoc>
23     public interface IHttpHandlerFactory {
24 
25         /// <devdoc>
26         ///    <para>
27         ///       Returns an instance of an IHttpHandler class.
28         ///    </para>
29         /// </devdoc>
GetHandler(HttpContext context, String requestType, String url, String pathTranslated)30         IHttpHandler GetHandler(HttpContext context, String requestType, String url, String pathTranslated);
31 
32         /// <devdoc>
33         ///    <para>
34         ///       Enables a factory to recycle or re-use an existing handler
35         ///       instance.
36         ///    </para>
37         /// </devdoc>
ReleaseHandler(IHttpHandler handler)38         void ReleaseHandler(IHttpHandler handler);
39     }
40 
41     internal interface IHttpHandlerFactory2 : IHttpHandlerFactory {
42 
43         /// <devdoc>
44         ///    <para>
45         ///       Returns an instance of an IHttpHandler class. Works directly with a VirtualPath object
46         ///       to avoid unnecessary conversions and creations.
47         ///    </para>
48         /// </devdoc>
GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)49         IHttpHandler GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath);
50     }
51 }
52