Castle.MonoRail.Framework.MonoRailHttpHandlerFactory.GetHandler C# (CSharp) Method

GetHandler() public method

Returns an instance of a class that implements the interface.
public GetHandler ( HttpContext context, String requestType, String url, String pathTranslated ) : IHttpHandler
context System.Web.HttpContext An instance of the class that provides references to intrinsic server objects (for example, Request, Response, Session, and Server) used to service HTTP requests.
requestType String The HTTP data transfer method (GET or POST) that the client uses.
url String The of the requested resource.
pathTranslated String The to the requested resource.
return IHttpHandler
		public virtual IHttpHandler GetHandler(HttpContext context, 
		                                       String requestType, 
		                                       String url, String pathTranslated)
		{
			if (!EngineContextModule.Initialized)
			{
				throw new RailsException("Looks like you forgot to register the http module " +
					typeof(EngineContextModule).FullName + "\r\nAdd '<add name=\"monorail\" type=\"Castle.MonoRail.Framework.EngineContextModule, Castle.MonoRail.Framework\" />' " +
					"to the <httpModules> section on your web.config");
			}

			IRailsEngineContext mrContext = EngineContextModule.ObtainRailsEngineContext(context);

			if (mrContext == null)
			{
				throw new RailsException("IRailsEngineContext is null. Looks like the " + 
					"EngineContextModule has not run for this request.");
			}

			return ObtainMonoRailHandler(mrContext);
		}