diff src/org/eclipse/jetty/server/AsyncContinuation.java @ 929:3191abe890ef

remove isInitial()
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 09 Oct 2016 19:13:46 -0600
parents 23a57aad34c0
children cd080b7bcf49
line wrap: on
line diff
--- a/src/org/eclipse/jetty/server/AsyncContinuation.java	Sun Oct 09 18:54:32 2016 -0600
+++ b/src/org/eclipse/jetty/server/AsyncContinuation.java	Sun Oct 09 19:13:46 2016 -0600
@@ -81,7 +81,6 @@
 
 	/* ------------------------------------------------------------ */
 	private int _state;
-	private boolean _initial;
 	private volatile boolean _responseWrapped;
 	private long _timeoutMs=DEFAULT_TIMEOUT;
 	private AsyncEventState _event;
@@ -91,7 +90,6 @@
 	protected AsyncContinuation()
 	{
 		_state=__IDLE;
-		_initial=true;
 	}
 
 	/* ------------------------------------------------------------ */
@@ -178,18 +176,15 @@
 		return _responseWrapped;
 	}
 
-	/* ------------------------------------------------------------ */
-	/* (non-Javadoc)
-	 * @see javax.servlet.ServletRequest#isInitial()
-	 */
+/*
 	public boolean isInitial()
 	{
 		synchronized(this)
 		{
-			return _initial;
+			return true;
 		}
 	}
-	
+*/	
 	/* ------------------------------------------------------------ */
 	/* (non-Javadoc)
 	 * @see javax.servlet.ServletRequest#isSuspended()
@@ -252,31 +247,22 @@
 				(_state==__DISPATCHED)?"DISPATCHED":
 											(_state==__UNCOMPLETED)?"UNCOMPLETED":
 												(_state==__COMPLETED)?"COMPLETE":
-													("UNKNOWN?"+_state))+
-			(_initial?",initial":"");
+													("UNKNOWN?"+_state));
 		}
 	}
 
-	/* ------------------------------------------------------------ */
-	/**
-	 * @return false if the handling of the request should not proceed
-	 */
-	protected boolean handling()
+	protected synchronized void handling()
 	{
-		synchronized (this)
+		switch(_state)
 		{
-			switch(_state)
-			{
-				case __IDLE:
-					_initial=true;
-					_state=__DISPATCHED;
-					if (_asyncListeners!=null)
-						_asyncListeners.clear();
-					return true;
-					
-				default:
-					throw new IllegalStateException(this.getStatusString());
-			}
+			case __IDLE:
+				_state=__DISPATCHED;
+				if (_asyncListeners!=null)
+					_asyncListeners.clear();
+				return;
+				
+			default:
+				throw new IllegalStateException(this.getStatusString());
 		}
 	}
 
@@ -301,18 +287,9 @@
 		}
 	}
 
-	/* ------------------------------------------------------------ */
 	public void dispatch()
 	{
-		boolean dispatch=false;
-		synchronized (this)
-		{
-			switch(_state)
-			{
-				default:
-					throw new IllegalStateException(this.getStatusString());
-			}
-		}
+		throw new UnsupportedOperationException();
 	}
 
 	/* ------------------------------------------------------------ */
@@ -448,7 +425,6 @@
 				default:
 					_state=__IDLE;
 			}
-			_initial = true;
 			_responseWrapped=false;
 			cancelTimeout();
 			_timeoutMs=DEFAULT_TIMEOUT;
@@ -494,19 +470,14 @@
 		}
 	}
 
-	/* ------------------------------------------------------------ */
 	public void dispatch(ServletContext context, String path)
 	{
-		_event._dispatchContext=context;
-		_event.setPath(path);
-		dispatch();
+		throw new UnsupportedOperationException();
 	}
 
-	/* ------------------------------------------------------------ */
 	public void dispatch(String path)
 	{
-		_event.setPath(path);
-		dispatch();
+		throw new UnsupportedOperationException();
 	}
 
 	/* ------------------------------------------------------------ */