Package javax.servlet

Examples of javax.servlet.AsyncContext.complete()


      asyncContext.addListener(new AsyncListener() {
        @Override
        public void onComplete(final AsyncEvent event) throws IOException {
          synchronized (queue.getActivationLock()) {
            queue.setActivationCallback(null);
            asyncContext.complete();
          }
        }

        @Override
        public void onTimeout(final AsyncEvent event) throws IOException {
View Full Code Here


      asyncContext.addListener(new AsyncListener() {
          @Override
          public void onComplete(final AsyncEvent event) throws IOException {
            synchronized (queue.getActivationLock()) {
              queue.setActivationCallback(null);
              asyncContext.complete();
            }
          }

          @Override
          public void onTimeout(final AsyncEvent event) throws IOException {
View Full Code Here

        });

      synchronized (queue.getActivationLock()) {
        if (queue.messagesWaiting()) {
          queue.poll(writer);
          asyncContext.complete();
          return;
        }

        queue.setActivationCallback(new QueueActivationCallback() {
          @Override
View Full Code Here

              catch (Throwable t2) {
                log.debug("Failed to write exception to dead client", t2);
              }
            }
            finally {
              asyncContext.complete();
            }
          }
        });
        writer.flush();
      }
View Full Code Here

      asyncContext.addListener(new AsyncListener() {
        @Override
        public void onComplete(final AsyncEvent event) throws IOException {
          synchronized (queue.getActivationLock()) {
            queue.setActivationCallback(null);
            asyncContext.complete();
          }
        }

        @Override
        public void onTimeout(final AsyncEvent event) throws IOException {
View Full Code Here

      asyncContext.addListener(new AsyncListener() {
          @Override
          public void onComplete(final AsyncEvent event) throws IOException {
            synchronized (queue.getActivationLock()) {
              queue.setActivationCallback(null);
              asyncContext.complete();
            }
          }

          @Override
          public void onTimeout(final AsyncEvent event) throws IOException {
View Full Code Here

        });

      synchronized (queue.getActivationLock()) {
        if (queue.messagesWaiting()) {
          queue.poll(writer);
          asyncContext.complete();
          return;
        }

        queue.setActivationCallback(new QueueActivationCallback() {
          @Override
View Full Code Here

              catch (IOException e) {
                throw new RuntimeException("Failed to write exception to output stream", e);
              }
            }
            finally {
              asyncContext.complete();
            }
          }
        });
        writer.flush();
      }
View Full Code Here

    assert Thread.holdsLock(response);
    assert session == null || !Thread.holdsLock(session);
   
    if (serverInitiated && suspendInfo != null) {
      AsyncContext asyncContext = (AsyncContext) suspendInfo;
      asyncContext.complete();
    }
  }
 
  @Override
  public void enqueued(CometSessionImpl session) {
View Full Code Here

            AsyncContext actxt = req.startAsync();
            actxt.setTimeout(3000);
            resp.setContentType("text/plain");
            resp.getWriter().print("OK");
            actxt.complete();
        }
    }

    @Test
    public void testTimeoutListenerCompleteNoDispatch() throws Exception {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.