private void OnBeginRequest(object sender, EventArgs e)
{
HttpApplication app = (HttpApplication) sender;
if (!IsMonoRailRequest(app.Context)) return;
IRailsEngineContext mrContext = ObtainContextFromApplication(sender);
if (mrContext == null) throw new NullReferenceException("mrContext");
if (container == null) throw new NullReferenceException("container");
if (container.extensionManager == null) throw new NullReferenceException("container.extensionManager");
container.extensionManager.RaiseContextCreated(mrContext);
}