diff src/org/eclipse/jetty/server/AsyncContinuation.java @ 917:1fc8ee20cb18

remove doSuspend
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 09 Oct 2016 03:23:55 -0600
parents b9aa175d9a29
children 7b62446899c6
line wrap: on
line diff
--- a/src/org/eclipse/jetty/server/AsyncContinuation.java	Sun Oct 09 02:08:40 2016 -0600
+++ b/src/org/eclipse/jetty/server/AsyncContinuation.java	Sun Oct 09 03:23:55 2016 -0600
@@ -340,59 +340,6 @@
 	}
 
 	/* ------------------------------------------------------------ */
-	/* (non-Javadoc)
-	 * @see javax.servlet.ServletRequest#suspend(long)
-	 */
-	private void doSuspend(final ServletContext context,
-			final ServletRequest request,
-			final ServletResponse response)
-	{
-		synchronized (this)
-		{
-			switch(_state)
-			{
-				case __DISPATCHED:
-				case __REDISPATCHED:
-					_resumed=false;
-					_expired=false;
-
-					if (_event==null || request!=_event.getSuppliedRequest() || response != _event.getSuppliedResponse() || context != _event.getServletContext())
-						_event=new AsyncEventState(context,request,response);
-					else
-					{
-						_event._dispatchContext=null;
-						_event._pathInContext=null;
-					}
-					_state=__ASYNCSTARTED;
-					List<AsyncListener> recycle=_lastAsyncListeners;
-					_lastAsyncListeners=_asyncListeners;
-					_asyncListeners=recycle;
-					if (_asyncListeners!=null)
-						_asyncListeners.clear();
-					break;
-
-				default:
-					throw new IllegalStateException(this.getStatusString());
-			}
-		}
-		
-		if (_lastAsyncListeners!=null)
-		{
-			for (AsyncListener listener : _lastAsyncListeners)
-			{
-				try
-				{
-					listener.onStartAsync(_event);
-				}
-				catch(Exception e)
-				{
-					LOG.warn("",e);
-				}
-			}
-		}
-	}
-
-	/* ------------------------------------------------------------ */
 	/**
 	 * Signal that the HttpConnection has finished handling the request.
 	 * For blocking connectors, this call may block if the request has
@@ -966,54 +913,6 @@
 	}
 	
 
-
-	/* ------------------------------------------------------------ */
-	protected void startAsync(final ServletContext context,
-			final ServletRequest request,
-			final ServletResponse response)
-	{
-		synchronized (this)
-		{
-			_responseWrapped=!(response instanceof Response);
-			doSuspend(context,request,response);
-			if (request instanceof HttpServletRequest)
-			{
-				_event._pathInContext = URIUtil.addPaths(((HttpServletRequest)request).getServletPath(),((HttpServletRequest)request).getPathInfo());
-			}
-		}
-	}
-
-	/* ------------------------------------------------------------ */
-	protected void startAsync()
-	{
-		_responseWrapped=false;
-		_continuation=false;
-		doSuspend(_connection.getRequest().getServletContext(),_connection.getRequest(),_connection.getResponse());  
-	}
-
-	
-	/* ------------------------------------------------------------ */
-	/**
-	 * @see Continuation#suspend()
-	 */
-	public void suspend(ServletResponse response)
-	{
-		_continuation=true;
-		_responseWrapped=!(response instanceof Response);
-		doSuspend(_connection.getRequest().getServletContext(),_connection.getRequest(),response); 
-	}
-
-	/* ------------------------------------------------------------ */
-	/**
-	 * @see Continuation#suspend()
-	 */
-	public void suspend()
-	{
-		_responseWrapped=false;
-		_continuation=true;
-		doSuspend(_connection.getRequest().getServletContext(),_connection.getRequest(),_connection.getResponse());       
-	}
-
 	/* ------------------------------------------------------------ */
 	/**
 	 * @see org.eclipse.jetty.continuation.Continuation#getServletResponse()