X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem.Web%2FSystem.Web%2FHttpRuntime.cs;h=d2822357434e406f738d294a8269f02c512fea75;hb=7a3dff8be5987d05481ff7c972524ca48d4cc94a;hp=2f234ef4ed3504db57184081085b2e91a61d8e08;hpb=0be292818eb53868d1cfe4956ab3a033480d22c7;p=mono.git diff --git a/mcs/class/System.Web/System.Web/HttpRuntime.cs b/mcs/class/System.Web/System.Web/HttpRuntime.cs index 2f234ef4ed3..d2822357434 100644 --- a/mcs/class/System.Web/System.Web/HttpRuntime.cs +++ b/mcs/class/System.Web/System.Web/HttpRuntime.cs @@ -46,12 +46,8 @@ using System.Web.UI; using System.Web.Util; using Mono.Web.Util; using System.Threading; -#if TARGET_J2EE -using Mainsoft.Web; -#else using System.CodeDom.Compiler; using System.Web.Compilation; -#endif namespace System.Web { @@ -61,53 +57,6 @@ namespace System.Web { static bool domainUnloading; static SplitOrderedList registeredAssemblies; -#if TARGET_J2EE - static QueueManager queue_manager { get { return _runtime._queue_manager; } } - static TraceManager trace_manager { get { return _runtime._trace_manager; } } - static Cache cache { get { return _runtime._cache; } } - static Cache internalCache { get { return _runtime._internalCache; } } - static WaitCallback do_RealProcessRequest; - - QueueManager _queue_manager; - TraceManager _trace_manager; - Cache _cache; - Cache _internalCache; - - public HttpRuntime () - { - WebConfigurationManager.Init (); - _queue_manager = new QueueManager (); - _trace_manager = new TraceManager (); - _cache = new Cache (); - _internalCache = new Cache(); - _internalCache.DependencyCache = _cache; - } - - static HttpRuntime _runtimeInstance { - get { - HttpRuntime runtime = (HttpRuntime) AppDomain.CurrentDomain.GetData ("HttpRuntime"); - if (runtime == null) - lock (typeof (HttpRuntime)) { - runtime = (HttpRuntime) AppDomain.CurrentDomain.GetData ("HttpRuntime"); - if (runtime == null) { - runtime = new HttpRuntime (); - AppDomain.CurrentDomain.SetData ("HttpRuntime", runtime); - } - } - return runtime; - } - } - static HttpRuntime _runtime - { - get - { - if (HttpContext.Current != null) - return HttpContext.Current.HttpRuntimeInstance; - else - return _runtimeInstance; - } - } -#else static QueueManager queue_manager; static TraceManager trace_manager; static Cache cache; @@ -125,11 +74,9 @@ namespace System.Web { } -#endif static HttpRuntime () { -#if !TARGET_J2EE firstRun = true; try { @@ -167,7 +114,6 @@ namespace System.Web cache = new Cache (); internalCache = new Cache (); internalCache.DependencyCache = internalCache; -#endif do_RealProcessRequest = new WaitCallback (state => { try { RealProcessRequest (state); @@ -326,7 +272,6 @@ namespace System.Web public static bool UsingIntegratedPipeline { get { return false; } } -#if NET_4_5 public static Version IISVersion { get { // Null means not hosted by IIS @@ -339,7 +284,6 @@ namespace System.Web return runtime_section.TargetFramework; } } -#endif [SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)] public static void Close () @@ -361,7 +305,6 @@ namespace System.Web return next; } -#if !TARGET_J2EE static readonly string[] app_offline_files = {"app_offline.htm", "App_Offline.htm", "APP_OFFLINE.HTM"}; static string app_offline_file; @@ -468,7 +411,6 @@ namespace System.Web SetOfflineMode (true, offlineFile); } } -#endif static void RealProcessRequest (object o) { @@ -488,13 +430,6 @@ namespace System.Web static void Process (HttpWorkerRequest req) { bool error = false; -#if TARGET_J2EE - HttpContext context = HttpContext.Current; - if (context == null) - context = new HttpContext (req); - else - context.SetWorkerRequest (req); -#else if (firstRun) { firstRun = false; if (initialException != null) { @@ -504,12 +439,9 @@ namespace System.Web SetupOfflineWatch (); } HttpContext context = new HttpContext (req); -#endif HttpContext.Current = context; -#if !TARGET_J2EE if (AppIsOffline (context)) return; -#endif // // Get application instance (create or reuse an instance of the correct class) @@ -536,26 +468,10 @@ namespace System.Web // Ask application to service the request // -#if TARGET_J2EE - IHttpAsyncHandler ihah = app; - if (context.Handler == null) - ihah.BeginProcessRequest (context, new AsyncCallback (request_processed), context); - else - app.Tick (); - //ihh.ProcessRequest (context); - IHttpExtendedHandler extHandler = context.Handler as IHttpExtendedHandler; - if (extHandler != null && !extHandler.IsCompleted) - return; - if (context.Error is UnifyRequestException) - return; - - ihah.EndProcessRequest (null); -#else IHttpHandler ihh = app; // IAsyncResult appiar = ihah.BeginProcessRequest (context, new AsyncCallback (request_processed), context); // ihah.EndProcessRequest (appiar); ihh.ProcessRequest (context); -#endif HttpApplicationFactory.Recycle (app); } @@ -588,26 +504,7 @@ namespace System.Web RealProcessRequest (request); } -#if TARGET_J2EE - // - // Callback to be invoked by IHttpAsyncHandler.BeginProcessRequest - // - static void request_processed (IAsyncResult iar) - { - HttpContext context = (HttpContext) iar.AsyncState; - - context.Request.ReleaseResources (); - context.Response.ReleaseResources (); - } -#endif -#if TARGET_JVM - [MonoNotSupported ("UnloadAppDomain is not supported")] - public static void UnloadAppDomain () - { - throw new NotImplementedException ("UnloadAppDomain is not supported"); - } -#else // // Called when we are shutting down or we need to reload an application // that has been modified (touch global.asax) @@ -628,7 +525,6 @@ namespace System.Web } }); } -#endif // // Shuts down the AppDomain // @@ -648,11 +544,7 @@ namespace System.Web static void DoUnload () { -#if TARGET_J2EE - // No unload support for appdomains under Grasshopper -#else AppDomain.Unload (AppDomain.CurrentDomain); -#endif } static string content503 = "\n" + @@ -702,7 +594,6 @@ namespace System.Web return null; } -#if !TARGET_J2EE static internal void WritePreservationFile (Assembly asm, string genericNameBase) { if (asm == null) @@ -775,7 +666,6 @@ namespace System.Web assemblyMappingEnabled = enable; } } -#endif // #if !TARGET_J2EE internal static TraceManager TraceManager { get {