public class MvcHandler : IHttpAsyncHandler
{
//其他成員
public RequestContext RequestContext { get; private set; }
public bool IsReusable
{
get { return false; }
}
public MvcHandler(RequestContext requestContext)
{
this
}
IAsyncResult BeginProcessRequest(HttpContext context
object extraData)
{
IControllerFactory controllerFactory =
ControllerBuilder
string controllerName =
this
IController controller = controllerFactory
if (controller is IAsyncController)
{
try
{
//調用BeginExecute/EndExecute方法以異步的方式執行Controller
}
finally
{
controllerFactory
}
}
else
{
try
{
//調用Execute方法以異步的方式執行Controller
}
finally
{
controllerFactory
}
}
}
}
由於MvcHandler同時實現了IHttpHandler和IHttpAsyncHandler接口
返回目錄
編輯推薦
ASP
Microsoft
Java程序性能優化
Visual C++音頻/視頻技術開發與實戰
[
From:http://tw.wingwit.com/Article/program/net/201311/16087.html