Mercurial Hosting > luan
comparison src/org/eclipse/jetty/server/AsyncContinuation.java @ 933:c9513d80f305
remove AsyncContext support
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 09 Oct 2016 20:25:02 -0600 |
parents | 947df3056ddb |
children | fe461f7cfc8e |
comparison
equal
deleted
inserted
replaced
932:947df3056ddb | 933:c9513d80f305 |
---|---|
16 // ======================================================================== | 16 // ======================================================================== |
17 // | 17 // |
18 | 18 |
19 package org.eclipse.jetty.server; | 19 package org.eclipse.jetty.server; |
20 | 20 |
21 import javax.servlet.AsyncContext; | |
22 import javax.servlet.AsyncEvent; | |
23 import javax.servlet.AsyncListener; | 21 import javax.servlet.AsyncListener; |
24 import javax.servlet.RequestDispatcher; | 22 import javax.servlet.RequestDispatcher; |
25 import javax.servlet.ServletException; | 23 import javax.servlet.ServletException; |
26 | 24 |
27 import java.util.ArrayList; | 25 import java.util.ArrayList; |
42 import org.slf4j.Logger; | 40 import org.slf4j.Logger; |
43 import org.slf4j.LoggerFactory; | 41 import org.slf4j.LoggerFactory; |
44 import org.eclipse.jetty.util.thread.Timeout; | 42 import org.eclipse.jetty.util.thread.Timeout; |
45 | 43 |
46 /* ------------------------------------------------------------ */ | 44 /* ------------------------------------------------------------ */ |
47 /** Implementation of Continuation and AsyncContext interfaces | 45 /** Implementation of Continuation interfaces |
48 * | 46 * |
49 */ | 47 */ |
50 public class AsyncContinuation implements AsyncContext, Continuation | 48 public class AsyncContinuation implements Continuation |
51 { | 49 { |
52 private static final Logger LOG = LoggerFactory.getLogger(AsyncContinuation.class); | 50 private static final Logger LOG = LoggerFactory.getLogger(AsyncContinuation.class); |
53 | 51 |
54 private final static long DEFAULT_TIMEOUT=30000L; | 52 private final static long DEFAULT_TIMEOUT=30000L; |
55 | 53 |
312 } | 310 } |
313 } | 311 } |
314 } | 312 } |
315 | 313 |
316 /* ------------------------------------------------------------ */ | 314 /* ------------------------------------------------------------ */ |
317 @Override | |
318 public <T extends AsyncListener> T createListener(Class<T> clazz) throws ServletException | |
319 { | |
320 try | |
321 { | |
322 // TODO inject | |
323 return clazz.newInstance(); | |
324 } | |
325 catch(Exception e) | |
326 { | |
327 throw new ServletException(e); | |
328 } | |
329 } | |
330 | |
331 | |
332 /* ------------------------------------------------------------ */ | |
333 /* (non-Javadoc) | 315 /* (non-Javadoc) |
334 * @see javax.servlet.ServletRequest#complete() | 316 * @see javax.servlet.ServletRequest#complete() |
335 */ | 317 */ |
336 protected void doComplete(Throwable ex) | 318 protected void doComplete(Throwable ex) |
337 { | 319 { |
524 public void setAttribute(String name, Object attribute) | 506 public void setAttribute(String name, Object attribute) |
525 { | 507 { |
526 _connection.getRequest().setAttribute(name,attribute); | 508 _connection.getRequest().setAttribute(name,attribute); |
527 } | 509 } |
528 | 510 |
529 | |
530 /* ------------------------------------------------------------ */ | |
531 /* ------------------------------------------------------------ */ | |
532 public class AsyncTimeout extends Timeout.Task implements Runnable | |
533 { | |
534 @Override | |
535 public void expired() | |
536 { | |
537 AsyncContinuation.this.expired(); | |
538 } | |
539 | |
540 @Override | |
541 public void run() | |
542 { | |
543 AsyncContinuation.this.expired(); | |
544 } | |
545 } | |
546 | |
547 } | 511 } |