Author: pferraro
Date: 2009-05-18 17:08:48 -0400 (Mon, 18 May 2009)
New Revision: 2437
Modified:
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/BusyConnectorsLoadServlet.java
Log:
Avoid maxing out connector thread pool
Modified:
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/BusyConnectorsLoadServlet.java
===================================================================
---
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/BusyConnectorsLoadServlet.java 2009-05-18
20:55:09 UTC (rev 2436)
+++
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/BusyConnectorsLoadServlet.java 2009-05-18
21:08:48 UTC (rev 2437)
@@ -30,7 +30,6 @@
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.HttpMethod;
-import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.HeadMethod;
import org.jboss.logging.Logger;
@@ -79,9 +78,9 @@
if (end > System.currentTimeMillis())
{
- HttpClient client = new HttpClient();
- HttpMethod method = new GetMethod(this.createLocalURL(request,
Collections.singletonMap(END, String.valueOf(end))));
- client.executeMethod(method);
+ String url = this.createLocalURL(request, Collections.singletonMap(END,
String.valueOf(end)));
+ Runnable task = new ExecuteMethodTask(url);
+ new Thread(task).start();
}
}
@@ -99,6 +98,8 @@
public void run()
{
+ Thread.yield();
+
HttpClient client = new HttpClient();
HttpMethod method = new HeadMethod(this.url);
Show replies by date