Timeout of handling requests is not supported in TARGET_J2EE (Thread.Abort not supported)
authorEyal Alalouf <eyala@mainsoft.com>
Mon, 25 Jul 2005 14:11:24 +0000 (14:11 -0000)
committerEyal Alalouf <eyala@mainsoft.com>
Mon, 25 Jul 2005 14:11:24 +0000 (14:11 -0000)
svn path=/trunk/mcs/; revision=47652

mcs/class/System.Web/ChangeLog
mcs/class/System.Web/System.Web.vmwcsproj
mcs/class/System.Web/System.Web/ChangeLog
mcs/class/System.Web/System.Web/HttpApplication.cs
mcs/class/System.Web/System.Web/HttpContext.cs
mcs/class/System.Web/System.Web/HttpRuntime.cs

index c4ef719bbb46f6b654a26ec8138abfeb8e1d4c4a..c2e188d5178869eb4b64d45252500b7b27585e93 100644 (file)
@@ -1,3 +1,6 @@
+2005-07-25  Eyal Alalouf  <eyala@mainsoft.com>
+       * System.Web.vmwcsproj removed System.Web/TimeoutManager.cs from TARGET_J2EE
+
 2005-07-24  Eyal Alalouf  <eyala@mainsoft.com>
        * System.Web.vmwcsproj added System.Web.UI/PageHandlerFactory.jvm.cs
 
index 1d169c25e62c0682417893f8d6f14209afbc8290..aa415d41b88f56fd179715d4159e1531252dbdec 100644 (file)
@@ -98,7 +98,6 @@
                                <File RelPath="System.Web\SiteMapResolveEventArgs.cs" SubType="Code" BuildAction="Compile"/>\r
                                <File RelPath="System.Web\StaticFileHandler.cs" SubType="Code" BuildAction="Compile"/>\r
                                <File RelPath="System.Web\StaticSiteMapProvider.cs" SubType="Code" BuildAction="Compile"/>\r
-                               <File RelPath="System.Web\TimeoutManager.cs" SubType="Code" BuildAction="Compile"/>\r
                                <File RelPath="System.Web\TraceContext.cs" SubType="Code" BuildAction="Compile"/>\r
                                <File RelPath="System.Web\TraceData.cs" SubType="Code" BuildAction="Compile"/>\r
                                <File RelPath="System.Web\TraceManager.cs" SubType="Code" BuildAction="Compile"/>\r
index 6542bea490aa3dc026e5196b33be6c1efa310a70..112a386e62b1b513841397b4f893aa16f02ca308 100644 (file)
@@ -1,3 +1,7 @@
+2005-07-25  Eyal Alalouf  <eyala@mainsoft.com>
+       * HttpContext.cs HttpRuntime.cs HttpApplication.cs: timeout is not supported
+         in TARGET_J2EE configuration (no Thread.Abort support).
+
 2005-07-25  Eyal Alalouf  <eyala@mainsoft.com>
        * QueueManager.cs: TARGET_J2EE fixes.
        * HttpApplicationFactory.cs: TARGET_J2EE fixes.
index 4fde25714463bba2c74aa0b1797d393aec2bb904..5e3dfb43931154ff214e34a6f835e080ddce7dcd 100644 (file)
@@ -1056,10 +1056,10 @@ namespace System.Web
                        internal void Start ()
                        {
                                Reset ();
-#if !TARGET_J2EE
-                               ExecuteNextAsync (null);
-#else
+#if TARGET_J2EE
                                ExecuteNext(null);
+#else
+                               ExecuteNextAsync (null);
 #endif
                        }
 
@@ -1138,7 +1138,7 @@ namespace System.Web
 #if TARGET_J2EE
                        private Exception HandleJavaException(Exception obj)
                        {
-                               Exception lasterror = null;
+                               Exception lasterror = obj;
 
                                if (obj is System.Reflection.TargetInvocationException ) 
                                {
@@ -1181,12 +1181,6 @@ namespace System.Web
                                                        _app.Context.EndTimeoutPossible ();
                                                }
                                        }
-#if TARGET_J2EE                //Catch case of aborting by timeout
-                                       if (_app.Context.TimedOut) {
-                                               _app.CompleteRequest ();
-                                               return null;
-                                       }
-#endif
                                        if (state.PossibleToTimeout) {
                                                // Async Execute
                                                _app.Context.TryWaitForTimeout ();
@@ -1386,14 +1380,18 @@ namespace System.Web
                        SaveThreadCulture ();
                        _savedContext = HttpContext.Context;
                        HttpContext.Context = _Context;
+#if !TARGET_J2EE
                        HttpRuntime.TimeoutManager.Add (_Context);
+#endif
                        SetPrincipal (_Context.User);
                }
 
                internal void OnStateExecuteLeave ()
                {
                        RestoreThreadCulture ();
+#if !TARGET_J2EE
                        HttpRuntime.TimeoutManager.Remove (_Context);
+#endif
                        HttpContext.Context = _savedContext;
                        RestorePrincipal ();
                }
index b7c049f55ec03fa2e68a6fdebb13707d2111ba86..478427f14e2d40d67267b540c5c70981f680f1f6 100644 (file)
@@ -231,17 +231,6 @@ namespace System.Web
                }
 #endif
 
-#if TARGET_J2EE
-               private bool _timedOut;
-               internal bool TimedOut {
-                       get {
-                               return _timedOut;
-                       }
-                       set {
-                               _timedOut = value;
-                       }
-               }
-#endif
                public IDictionary Items
                {
                        get {
index 72a4d589f868820e4fc28c7270ec93bb3fc2c6ae..a9c35929b76e834bc073e3c4c07ca975e12f2fa0 100644 (file)
@@ -86,7 +86,9 @@ namespace System.Web {
                //private bool _firstRequestExecuted;
 
                private Exception _initError;
+#if !TARGET_J2EE
                private TimeoutManager timeoutManager;
+#endif
                private QueueManager queueManager;
                private TraceManager traceManager;
                private WaitCallback doRequestCallback;
@@ -113,7 +115,9 @@ namespace System.Web {
                {
                        try {
                                _cache = new Cache ();
+#if !TARGET_J2EE
                                timeoutManager = new TimeoutManager ();
+#endif
 
                                _endOfSendCallback = new HttpWorkerRequest.EndOfSendNotification (OnEndOfSend);
                                _handlerCallback = new AsyncCallback (OnHandlerReady);
@@ -276,7 +280,8 @@ namespace System.Web {
 
                internal void Dispose() {
                        WaitForRequests (2000);
-                       queueManager.Dispose (); // Send a 503 to all queued requests
+                       if (queueManager != null)
+                               queueManager.Dispose (); // Send a 503 to all queued requests
                        queueManager = null;
                        _cache = null;
                        HttpApplicationFactory.EndApplication();
@@ -496,11 +501,13 @@ namespace System.Web {
                        }
                }
 
+#if !TARGET_J2EE
                internal static TimeoutManager TimeoutManager {
                        get {
                                return HttpRuntime._runtime.timeoutManager;
                        }
                }
+#endif
 
                 internal static TraceManager TraceManager {
                         get {