From: remm Date: Sat, 29 Apr 2006 00:23:12 +0000 (+0000) Subject: - Remove usage of TWA (otherwise, executor support cannot work). X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=119161834dc37d4dc45910aa348392e614a4b704;p=tomcat7.0 - Remove usage of TWA (otherwise, executor support cannot work). git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@398045 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/coyote/ajp/AjpAprProcessor.java b/java/org/apache/coyote/ajp/AjpAprProcessor.java index 7b070a246..bcd45e8f2 100644 --- a/java/org/apache/coyote/ajp/AjpAprProcessor.java +++ b/java/org/apache/coyote/ajp/AjpAprProcessor.java @@ -41,7 +41,6 @@ import org.apache.tomcat.util.http.HttpMessages; import org.apache.tomcat.util.http.MimeHeaders; import org.apache.tomcat.util.net.AprEndpoint; import org.apache.tomcat.util.res.StringManager; -import org.apache.tomcat.util.threads.ThreadWithAttributes; /** @@ -338,10 +337,7 @@ public class AjpAprProcessor implements ActionHook { */ public boolean process(long socket) throws IOException { - ThreadWithAttributes thrA= - (ThreadWithAttributes)Thread.currentThread(); RequestInfo rp = request.getRequestProcessor(); - thrA.setCurrentStage(endpoint, "parsing http request"); rp.setStage(org.apache.coyote.Constants.STAGE_PARSE); // Setting up the socket @@ -405,11 +401,9 @@ public class AjpAprProcessor implements ActionHook { } // Setting up filters, and parse some request headers - thrA.setCurrentStage(endpoint, "prepareRequest"); rp.setStage(org.apache.coyote.Constants.STAGE_PREPARE); try { prepareRequest(); - thrA.setParam(endpoint, request.requestURI()); } catch (Throwable t) { log.debug(sm.getString("ajpprocessor.request.prepare"), t); // 400 - Internal Server Error @@ -420,7 +414,6 @@ public class AjpAprProcessor implements ActionHook { // Process the request in the adapter if (!error) { try { - thrA.setCurrentStage(endpoint, "service"); rp.setStage(org.apache.coyote.Constants.STAGE_SERVICE); adapter.service(request, response); } catch (InterruptedIOException e) { @@ -449,7 +442,6 @@ public class AjpAprProcessor implements ActionHook { } request.updateCounters(); - thrA.setCurrentStage(endpoint, "ended"); rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE); recycle(); diff --git a/java/org/apache/coyote/ajp/AjpProcessor.java b/java/org/apache/coyote/ajp/AjpProcessor.java index a1f883d81..faf8507b9 100644 --- a/java/org/apache/coyote/ajp/AjpProcessor.java +++ b/java/org/apache/coyote/ajp/AjpProcessor.java @@ -41,7 +41,6 @@ import org.apache.tomcat.util.http.HttpMessages; import org.apache.tomcat.util.http.MimeHeaders; import org.apache.tomcat.util.net.JIoEndpoint; import org.apache.tomcat.util.res.StringManager; -import org.apache.tomcat.util.threads.ThreadWithAttributes; /** @@ -326,10 +325,7 @@ public class AjpProcessor implements ActionHook { */ public boolean process(Socket socket) throws IOException { - ThreadWithAttributes thrA= - (ThreadWithAttributes)Thread.currentThread(); RequestInfo rp = request.getRequestProcessor(); - thrA.setCurrentStage(endpoint, "parsing http request"); rp.setStage(org.apache.coyote.Constants.STAGE_PARSE); // Setting up the socket @@ -382,11 +378,9 @@ public class AjpProcessor implements ActionHook { } // Setting up filters, and parse some request headers - thrA.setCurrentStage(endpoint, "prepareRequest"); rp.setStage(org.apache.coyote.Constants.STAGE_PREPARE); try { prepareRequest(); - thrA.setParam(endpoint, request.requestURI()); } catch (Throwable t) { log.debug(sm.getString("ajpprocessor.request.prepare"), t); // 400 - Internal Server Error @@ -397,7 +391,6 @@ public class AjpProcessor implements ActionHook { // Process the request in the adapter if (!error) { try { - thrA.setCurrentStage(endpoint, "service"); rp.setStage(org.apache.coyote.Constants.STAGE_SERVICE); adapter.service(request, response); } catch (InterruptedIOException e) { @@ -426,7 +419,6 @@ public class AjpProcessor implements ActionHook { } request.updateCounters(); - thrA.setCurrentStage(endpoint, "ended"); rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE); recycle(); diff --git a/java/org/apache/coyote/http11/Http11AprProcessor.java b/java/org/apache/coyote/http11/Http11AprProcessor.java index 955acb1b2..47267de76 100644 --- a/java/org/apache/coyote/http11/Http11AprProcessor.java +++ b/java/org/apache/coyote/http11/Http11AprProcessor.java @@ -53,7 +53,6 @@ import org.apache.tomcat.util.http.FastHttpDateFormat; import org.apache.tomcat.util.http.MimeHeaders; import org.apache.tomcat.util.net.AprEndpoint; import org.apache.tomcat.util.res.StringManager; -import org.apache.tomcat.util.threads.ThreadWithAttributes; /** @@ -738,10 +737,7 @@ public class Http11AprProcessor implements ActionHook { */ public boolean process(long socket) throws IOException { - ThreadWithAttributes thrA= - (ThreadWithAttributes)Thread.currentThread(); RequestInfo rp = request.getRequestProcessor(); - thrA.setCurrentStage(endpoint, "parsing http request"); rp.setStage(org.apache.coyote.Constants.STAGE_PARSE); // Set the remote address @@ -790,7 +786,6 @@ public class Http11AprProcessor implements ActionHook { break; } request.setStartTime(System.currentTimeMillis()); - thrA.setParam(endpoint, request.requestURI()); keptAlive = true; if (!disableUploadTimeout) { Socket.timeoutSet(socket, timeout * 1000); @@ -809,7 +804,6 @@ public class Http11AprProcessor implements ActionHook { } // Setting up filters, and parse some request headers - thrA.setCurrentStage(endpoint, "prepareRequest"); rp.setStage(org.apache.coyote.Constants.STAGE_PREPARE); try { prepareRequest(); @@ -828,7 +822,6 @@ public class Http11AprProcessor implements ActionHook { // Process the request in the adapter if (!error) { try { - thrA.setCurrentStage(endpoint, "service"); rp.setStage(org.apache.coyote.Constants.STAGE_SERVICE); adapter.service(request, response); // Handle when the response was committed before a serious @@ -853,7 +846,6 @@ public class Http11AprProcessor implements ActionHook { // Finish the handling of the request try { - thrA.setCurrentStage(endpoint, "endRequestIB"); rp.setStage(org.apache.coyote.Constants.STAGE_ENDINPUT); inputBuffer.endRequest(); } catch (IOException e) { @@ -865,7 +857,6 @@ public class Http11AprProcessor implements ActionHook { error = true; } try { - thrA.setCurrentStage(endpoint, "endRequestOB"); rp.setStage(org.apache.coyote.Constants.STAGE_ENDOUTPUT); outputBuffer.endRequest(); } catch (IOException e) { @@ -882,7 +873,6 @@ public class Http11AprProcessor implements ActionHook { } request.updateCounters(); - thrA.setCurrentStage(endpoint, "ended"); rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE); // Don't reset the param - we'll see it as ended. Next request diff --git a/java/org/apache/coyote/http11/Http11Processor.java b/java/org/apache/coyote/http11/Http11Processor.java index 73e5a99e5..11cd2ec99 100644 --- a/java/org/apache/coyote/http11/Http11Processor.java +++ b/java/org/apache/coyote/http11/Http11Processor.java @@ -50,7 +50,6 @@ import org.apache.tomcat.util.http.MimeHeaders; import org.apache.tomcat.util.net.JIoEndpoint; import org.apache.tomcat.util.net.SSLSupport; import org.apache.tomcat.util.res.StringManager; -import org.apache.tomcat.util.threads.ThreadWithAttributes; /** @@ -728,10 +727,7 @@ public class Http11Processor implements ActionHook { */ public void process(Socket socket) throws IOException { - ThreadWithAttributes thrA= - (ThreadWithAttributes)Thread.currentThread(); RequestInfo rp = request.getRequestProcessor(); - thrA.setCurrentStage(endpoint, "parsing http request"); rp.setStage(org.apache.coyote.Constants.STAGE_PARSE); // Set the remote address @@ -787,7 +783,6 @@ public class Http11Processor implements ActionHook { } inputBuffer.parseRequestLine(); request.setStartTime(System.currentTimeMillis()); - thrA.setParam( endpoint, request.requestURI() ); keptAlive = true; if (!disableUploadTimeout) { socket.setSoTimeout(timeout); @@ -806,7 +801,6 @@ public class Http11Processor implements ActionHook { } // Setting up filters, and parse some request headers - thrA.setCurrentStage(endpoint, "prepareRequest"); rp.setStage(org.apache.coyote.Constants.STAGE_PREPARE); try { prepareRequest(); @@ -825,7 +819,6 @@ public class Http11Processor implements ActionHook { // Process the request in the adapter if (!error) { try { - thrA.setCurrentStage(endpoint, "service"); rp.setStage(org.apache.coyote.Constants.STAGE_SERVICE); adapter.service(request, response); // Handle when the response was committed before a serious @@ -850,7 +843,6 @@ public class Http11Processor implements ActionHook { // Finish the handling of the request try { - thrA.setCurrentStage(endpoint, "endRequestIB"); rp.setStage(org.apache.coyote.Constants.STAGE_ENDINPUT); inputBuffer.endRequest(); } catch (IOException e) { @@ -862,7 +854,6 @@ public class Http11Processor implements ActionHook { error = true; } try { - thrA.setCurrentStage(endpoint, "endRequestOB"); rp.setStage(org.apache.coyote.Constants.STAGE_ENDOUTPUT); outputBuffer.endRequest(); } catch (IOException e) { @@ -879,7 +870,6 @@ public class Http11Processor implements ActionHook { } request.updateCounters(); - thrA.setCurrentStage(endpoint, "ended"); rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE); // Don't reset the param - we'll see it as ended. Next request diff --git a/java/org/apache/tomcat/util/net/AprEndpoint.java b/java/org/apache/tomcat/util/net/AprEndpoint.java index 4b34802f8..96a58a9c9 100644 --- a/java/org/apache/tomcat/util/net/AprEndpoint.java +++ b/java/org/apache/tomcat/util/net/AprEndpoint.java @@ -36,7 +36,6 @@ import org.apache.tomcat.jni.SSLSocket; import org.apache.tomcat.jni.Socket; import org.apache.tomcat.jni.Status; import org.apache.tomcat.util.res.StringManager; -import org.apache.tomcat.util.threads.ThreadWithAttributes; /** * APR tailored thread pool, providing the following services: @@ -1325,7 +1324,7 @@ public class AprEndpoint { * Start the background processing thread. */ public void start() { - thread = new ThreadWithAttributes(AprEndpoint.this, this); + thread = new Thread(this); thread.setName(getName() + "-" + (++curThreads)); thread.setDaemon(true); thread.start(); diff --git a/java/org/apache/tomcat/util/net/JIoEndpoint.java b/java/org/apache/tomcat/util/net/JIoEndpoint.java index 38cee5ee5..e502a3adc 100644 --- a/java/org/apache/tomcat/util/net/JIoEndpoint.java +++ b/java/org/apache/tomcat/util/net/JIoEndpoint.java @@ -26,7 +26,6 @@ import java.util.concurrent.Executor; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.tomcat.util.res.StringManager; -import org.apache.tomcat.util.threads.ThreadWithAttributes; /** * Handle incoming TCP connections. @@ -463,7 +462,7 @@ public class JIoEndpoint { * Start the background processing thread. */ public void start() { - thread = new ThreadWithAttributes(JIoEndpoint.this, this); + thread = new Thread(this); thread.setName(getName() + "-" + (++curThreads)); thread.setDaemon(true); thread.start();