geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pra...@apache.org
Subject svn commit: r574364 - in /geronimo/samples/trunk/samples/async-http/http-local-app/src/main: java/org/apache/geronimo/AsyncServlet.java webapp/WEB-INF/web.xml
Date Mon, 10 Sep 2007 20:41:11 GMT
Author: prasad
Date: Mon Sep 10 13:41:10 2007
New Revision: 574364

URL: http://svn.apache.org/viewvc?rev=574364&view=rev
Log:
* removed <load-on-startup>

Modified:
    geronimo/samples/trunk/samples/async-http/http-local-app/src/main/java/org/apache/geronimo/AsyncServlet.java
    geronimo/samples/trunk/samples/async-http/http-local-app/src/main/webapp/WEB-INF/web.xml

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=574364&r1=574363&r2=574364&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
Mon Sep 10 13:41:10 2007
@@ -23,6 +23,14 @@
  */
 public class AsyncServlet extends HttpServlet implements CometProcessor {
 	static final long serialVersionUID = 1L;
+	
+	private String remoteUrl;
+	
+	public void init() throws ServletException {
+        getServletContext().log("getinit init");
+        // Get the value of an initialization parameter
+        remoteUrl = getServletConfig().getInitParameter("remoteUrl");
+	}
 
 	/**
 	 * Process the given Comet event.
@@ -56,12 +64,11 @@
 			}
 			msgRequest.setRequestMethod(HttpRequestMessage.REQUEST_GET);
 
-			// URL url_connect = new URL(request.getParameter("remoteUrl"));
-			// URL url_connect = new
-			// URL(getServletContext().getInitParameter("remoteUrl"));
-			URL url_connect = new URL("http://puffyshirt:8080");
+			System.out.println(remoteUrl);
+			URL url_connect = new URL(remoteUrl);
+			//URL url_connect = new URL("http://puffyshirt:8080");
 
-			AsyncHttpClient ahc = new AsyncHttpClient(url_connect, callback, 30000, 250);
+			AsyncHttpClient ahc = new AsyncHttpClient(url_connect, callback);
 			try {
 				ahc.connect();
 				ahc.sendRequest(msgRequest);
@@ -81,7 +88,7 @@
 		Random generator = new Random();
 
 		// generate a random delay between 10ms and 250 ms
-		int delay = generator.nextInt(290) + 10;
+		int delay = generator.nextInt(240) + 10;
 		params[0] = new Integer(delay);
 
 		// generate randomly one of http status codes.

Modified: geronimo/samples/trunk/samples/async-http/http-local-app/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/async-http/http-local-app/src/main/webapp/WEB-INF/web.xml?rev=574364&r1=574363&r2=574364&view=diff
==============================================================================
--- geronimo/samples/trunk/samples/async-http/http-local-app/src/main/webapp/WEB-INF/web.xml
(original)
+++ geronimo/samples/trunk/samples/async-http/http-local-app/src/main/webapp/WEB-INF/web.xml
Mon Sep 10 13:41:10 2007
@@ -11,12 +11,11 @@
 		<display-name>AsyncServlet</display-name>
 		<servlet-name>AsyncServlet</servlet-name>
 		<servlet-class>org.apache.geronimo.AsyncServlet</servlet-class>
-		<load-on-startup>0</load-on-startup>
-		<!--<init-param>
+        <init-param>
 			<param-name>remoteUrl</param-name>
 			<param-value>http://puffyshirt:8080</param-value>
   	    </init-param>      
-	--></servlet>
+	</servlet>
 
 
 	<servlet-mapping>



Mime
View raw message