changeset 938:a088981f9cd4

remove more async code
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 09 Oct 2016 23:48:32 -0600
parents 0541b6034003
children 8db5996c8c89
files src/org/eclipse/jetty/server/AsyncContinuation.java src/org/eclipse/jetty/server/Request.java src/org/eclipse/jetty/server/handler/RequestLogHandler.java
diffstat 3 files changed, 2 insertions(+), 46 deletions(-) [+]
line wrap: on
line diff
--- a/src/org/eclipse/jetty/server/AsyncContinuation.java	Sun Oct 09 21:41:28 2016 -0600
+++ b/src/org/eclipse/jetty/server/AsyncContinuation.java	Sun Oct 09 23:48:32 2016 -0600
@@ -18,7 +18,6 @@
 
 package org.eclipse.jetty.server;
 
-import org.eclipse.jetty.io.EndPoint;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -26,8 +25,6 @@
 public final class AsyncContinuation
 {
 	private static final Logger LOG = LoggerFactory.getLogger(AsyncContinuation.class);
-
-	private final static long DEFAULT_TIMEOUT=30000L;
 		
 	// STATES:
 	//               handling()    suspend()     unhandle()    resume()       complete()  doComplete()
@@ -47,10 +44,6 @@
 	private static final int __UNCOMPLETED=8;  // Request is completable
 	private static final int __COMPLETED=9;    // Request is complete
 	
-	/* ------------------------------------------------------------ */
-	protected AbstractHttpConnection _connection;
-
-	/* ------------------------------------------------------------ */
 	private int _state;
 	
 	AsyncContinuation()
@@ -58,12 +51,6 @@
 		_state=__IDLE;
 	}
 
-	protected synchronized void setConnection(final AbstractHttpConnection connection)
-	{
-		_connection=connection;
-	}
-
-	
 	@Override
 	public synchronized String toString()
 	{
@@ -137,21 +124,8 @@
 			default:
 				_state=__IDLE;
 		}
-		cancelTimeout();
 	}    
 	
-	private void cancelTimeout()
-	{
-		EndPoint endp=_connection.getEndPoint();
-		if (endp.isBlocking())
-		{
-			synchronized(this)
-			{
-				this.notifyAll();
-			}
-		}
-	}
-
 	synchronized boolean isUncompleted()
 	{
 		return _state==__UNCOMPLETED;
--- a/src/org/eclipse/jetty/server/Request.java	Sun Oct 09 21:41:28 2016 -0600
+++ b/src/org/eclipse/jetty/server/Request.java	Sun Oct 09 23:48:32 2016 -0600
@@ -141,8 +141,7 @@
 
 		return AbstractHttpConnection.getCurrentConnection().getRequest();
 	}
-	protected final AsyncContinuation _async = new AsyncContinuation();
-	private boolean _asyncSupported = true;
+	final AsyncContinuation _async = new AsyncContinuation();
 	private volatile Attributes _attributes;
 	private MultiMap<String> _baseParameters;
 	private String _characterEncoding;
@@ -370,12 +369,6 @@
 	}
 
 	/* ------------------------------------------------------------ */
-	public AsyncContinuation getAsyncContinuation()
-	{
-		return _async;
-	}
-	
-	/* ------------------------------------------------------------ */
 	/*
 	 * @see javax.servlet.ServletRequest#getAttribute(java.lang.String)
 	 */
@@ -1216,10 +1209,9 @@
 	}
 
 
-	/* ------------------------------------------------------------ */
 	public boolean isAsyncSupported()
 	{
-		return _asyncSupported;
+		return false;
 	}
 
 	/* ------------------------------------------------------------ */
@@ -1282,7 +1274,6 @@
 		throw new UnsupportedOperationException();
 	}
 
-	/* ------------------------------------------------------------ */
 	protected void recycle()
 	{
 		if (_inputState == __READER)
@@ -1301,7 +1292,6 @@
 		}
 
 		_async.recycle();
-		_asyncSupported = true;
 		_handled = false;
 		if (_context != null)
 			throw new IllegalStateException("Request in context!");
@@ -1370,12 +1360,6 @@
 	}
 
 	/* ------------------------------------------------------------ */
-	public void setAsyncSupported(boolean supported)
-	{
-		_asyncSupported = supported;
-	}
-
-	/* ------------------------------------------------------------ */
 	/*
 	 * Set a request attribute. if the attribute name is "org.eclipse.jetty.server.server.Request.queryEncoding" then the value is also passed in a call to
 	 * {@link #setQueryEncoding}. <p> if the attribute name is "org.eclipse.jetty.server.server.ResponseBuffer", then the response buffer is flushed with @{link
@@ -1499,7 +1483,6 @@
 	protected final void setConnection(AbstractHttpConnection connection)
 	{
 		_connection = connection;
-		_async.setConnection(connection);
 		_endp = connection.getEndPoint();
 	}
 
--- a/src/org/eclipse/jetty/server/handler/RequestLogHandler.java	Sun Oct 09 21:41:28 2016 -0600
+++ b/src/org/eclipse/jetty/server/handler/RequestLogHandler.java	Sun Oct 09 23:48:32 2016 -0600
@@ -36,7 +36,6 @@
 import javax.servlet.http.HttpServletResponse;
 
 import org.eclipse.jetty.http.HttpHeaders;
-import org.eclipse.jetty.server.AsyncContinuation;
 import org.eclipse.jetty.server.Request;
 import org.eclipse.jetty.server.Response;
 import org.eclipse.jetty.server.Server;