Mercurial Hosting > luan
comparison src/org/eclipse/jetty/server/Request.java @ 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 |
comparison
equal
deleted
inserted
replaced
| 937:0541b6034003 | 938:a088981f9cd4 |
|---|---|
| 139 if (request instanceof Request) | 139 if (request instanceof Request) |
| 140 return (Request)request; | 140 return (Request)request; |
| 141 | 141 |
| 142 return AbstractHttpConnection.getCurrentConnection().getRequest(); | 142 return AbstractHttpConnection.getCurrentConnection().getRequest(); |
| 143 } | 143 } |
| 144 protected final AsyncContinuation _async = new AsyncContinuation(); | 144 final AsyncContinuation _async = new AsyncContinuation(); |
| 145 private boolean _asyncSupported = true; | |
| 146 private volatile Attributes _attributes; | 145 private volatile Attributes _attributes; |
| 147 private MultiMap<String> _baseParameters; | 146 private MultiMap<String> _baseParameters; |
| 148 private String _characterEncoding; | 147 private String _characterEncoding; |
| 149 protected AbstractHttpConnection _connection; | 148 protected AbstractHttpConnection _connection; |
| 150 private ContextHandler.Context _context; | 149 private ContextHandler.Context _context; |
| 368 { | 367 { |
| 369 throw new UnsupportedOperationException(); | 368 throw new UnsupportedOperationException(); |
| 370 } | 369 } |
| 371 | 370 |
| 372 /* ------------------------------------------------------------ */ | 371 /* ------------------------------------------------------------ */ |
| 373 public AsyncContinuation getAsyncContinuation() | |
| 374 { | |
| 375 return _async; | |
| 376 } | |
| 377 | |
| 378 /* ------------------------------------------------------------ */ | |
| 379 /* | 372 /* |
| 380 * @see javax.servlet.ServletRequest#getAttribute(java.lang.String) | 373 * @see javax.servlet.ServletRequest#getAttribute(java.lang.String) |
| 381 */ | 374 */ |
| 382 public Object getAttribute(String name) | 375 public Object getAttribute(String name) |
| 383 { | 376 { |
| 1214 { | 1207 { |
| 1215 return false; | 1208 return false; |
| 1216 } | 1209 } |
| 1217 | 1210 |
| 1218 | 1211 |
| 1219 /* ------------------------------------------------------------ */ | |
| 1220 public boolean isAsyncSupported() | 1212 public boolean isAsyncSupported() |
| 1221 { | 1213 { |
| 1222 return _asyncSupported; | 1214 return false; |
| 1223 } | 1215 } |
| 1224 | 1216 |
| 1225 /* ------------------------------------------------------------ */ | 1217 /* ------------------------------------------------------------ */ |
| 1226 /* | 1218 /* |
| 1227 * @see javax.servlet.http.HttpServletRequest#isRequestedSessionIdFromCookie() | 1219 * @see javax.servlet.http.HttpServletRequest#isRequestedSessionIdFromCookie() |
| 1280 public HttpSession recoverNewSession(Object key) | 1272 public HttpSession recoverNewSession(Object key) |
| 1281 { | 1273 { |
| 1282 throw new UnsupportedOperationException(); | 1274 throw new UnsupportedOperationException(); |
| 1283 } | 1275 } |
| 1284 | 1276 |
| 1285 /* ------------------------------------------------------------ */ | |
| 1286 protected void recycle() | 1277 protected void recycle() |
| 1287 { | 1278 { |
| 1288 if (_inputState == __READER) | 1279 if (_inputState == __READER) |
| 1289 { | 1280 { |
| 1290 try | 1281 try |
| 1299 _reader = null; | 1290 _reader = null; |
| 1300 } | 1291 } |
| 1301 } | 1292 } |
| 1302 | 1293 |
| 1303 _async.recycle(); | 1294 _async.recycle(); |
| 1304 _asyncSupported = true; | |
| 1305 _handled = false; | 1295 _handled = false; |
| 1306 if (_context != null) | 1296 if (_context != null) |
| 1307 throw new IllegalStateException("Request in context!"); | 1297 throw new IllegalStateException("Request in context!"); |
| 1308 if (_attributes != null) | 1298 if (_attributes != null) |
| 1309 _attributes.clearAttributes(); | 1299 _attributes.clearAttributes(); |
| 1368 { | 1358 { |
| 1369 _requestAttributeListeners = LazyList.remove(_requestAttributeListeners,listener); | 1359 _requestAttributeListeners = LazyList.remove(_requestAttributeListeners,listener); |
| 1370 } | 1360 } |
| 1371 | 1361 |
| 1372 /* ------------------------------------------------------------ */ | 1362 /* ------------------------------------------------------------ */ |
| 1373 public void setAsyncSupported(boolean supported) | |
| 1374 { | |
| 1375 _asyncSupported = supported; | |
| 1376 } | |
| 1377 | |
| 1378 /* ------------------------------------------------------------ */ | |
| 1379 /* | 1363 /* |
| 1380 * 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 | 1364 * 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 |
| 1381 * {@link #setQueryEncoding}. <p> if the attribute name is "org.eclipse.jetty.server.server.ResponseBuffer", then the response buffer is flushed with @{link | 1365 * {@link #setQueryEncoding}. <p> if the attribute name is "org.eclipse.jetty.server.server.ResponseBuffer", then the response buffer is flushed with @{link |
| 1382 * #flushResponseBuffer} <p> if the attribute name is "org.eclipse.jetty.io.EndPoint.maxIdleTime", then the value is passed to the associated {@link | 1366 * #flushResponseBuffer} <p> if the attribute name is "org.eclipse.jetty.io.EndPoint.maxIdleTime", then the value is passed to the associated {@link |
| 1383 * EndPoint#setMaxIdleTime}. | 1367 * EndPoint#setMaxIdleTime}. |
| 1497 /* ------------------------------------------------------------ */ | 1481 /* ------------------------------------------------------------ */ |
| 1498 // final so we can safely call this from constructor | 1482 // final so we can safely call this from constructor |
| 1499 protected final void setConnection(AbstractHttpConnection connection) | 1483 protected final void setConnection(AbstractHttpConnection connection) |
| 1500 { | 1484 { |
| 1501 _connection = connection; | 1485 _connection = connection; |
| 1502 _async.setConnection(connection); | |
| 1503 _endp = connection.getEndPoint(); | 1486 _endp = connection.getEndPoint(); |
| 1504 } | 1487 } |
| 1505 | 1488 |
| 1506 /* ------------------------------------------------------------ */ | 1489 /* ------------------------------------------------------------ */ |
| 1507 /* | 1490 /* |
