geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r612423 - /geronimo/samples/trunk/samples/async-http/http-local-app/src/main/java/org/apache/geronimo/AsyncServlet.java
Date Wed, 16 Jan 2008 11:35:44 GMT
Author: rickmcguire
Date: Wed Jan 16 03:35:19 2008
New Revision: 612423

URL: http://svn.apache.org/viewvc?rev=612423&view=rev
Log:
GERONIMO-3749 Global session cache can cause multiple client instances to reuse incorrectly
configured connections.

Update sample to recent API changes. 


Modified:
    geronimo/samples/trunk/samples/async-http/http-local-app/src/main/java/org/apache/geronimo/AsyncServlet.java

Modified: geronimo/samples/trunk/samples/async-http/http-local-app/src/main/java/org/apache/geronimo/AsyncServlet.java
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/async-http/http-local-app/src/main/java/org/apache/geronimo/AsyncServlet.java?rev=612423&r1=612422&r2=612423&view=diff
==============================================================================
--- geronimo/samples/trunk/samples/async-http/http-local-app/src/main/java/org/apache/geronimo/AsyncServlet.java
(original)
+++ geronimo/samples/trunk/samples/async-http/http-local-app/src/main/java/org/apache/geronimo/AsyncServlet.java
Wed Jan 16 03:35:19 2008
@@ -28,6 +28,7 @@
 
 import org.apache.ahc.AsyncHttpClient;
 import org.apache.ahc.codec.HttpRequestMessage;
+import org.apache.ahc.codec.SessionCache;       
 import org.apache.catalina.CometEvent;
 import org.apache.catalina.CometProcessor;
 
@@ -52,14 +53,16 @@
 	private String remoteUrl;
 	private static AsyncHttpClient ahc;
 	private static ExecutorService threadPool;
+    private static SessionCache sessionCache; 
 
 	public void init() throws ServletException {
 		remoteUrl = getServletConfig().getInitParameter("remoteUrl");
 
 		threadPool = Executors.newCachedThreadPool();
+        sessionCache = new SessionCache(); 
     	ahc = new AsyncHttpClient(threadPool, null);
     	// enable connection reuse
-    	ahc.setReuseConnection(true);
+    	ahc.setSessionCache(sessionCache); 
     	// disable TCP delay
     	ahc.setTcpNoDelay(true);
 	}



Mime
View raw message