Castle.MonoRail.Framework.EngineContextModule.CreateController C# (CSharp) Method

CreateController() private method

Uses the url information and the controller factory to instantiate the proper controller.
private CreateController ( IRailsEngineContext context ) : Controller
context IRailsEngineContext MonoRail's request context
return Controller
		private Controller CreateController(IRailsEngineContext context)
		{
			UrlInfo info = context.UrlInfo;

			if (logger.IsDebugEnabled)
			{
				logger.DebugFormat("Starting request process for '{0}'/'{1}.{2}' Extension '{3}' with url '{4}'",
					info.Area, info.Controller, info.Action, info.Extension, info.UrlRaw);
			}

			IControllerFactory controllerFactory = (IControllerFactory) context.GetService(typeof(IControllerFactory));

			Controller controller = controllerFactory.CreateController(info);

			return controller;
		}