Package javax.servlet

Examples of javax.servlet.AsyncListener


        this.traceRequests = metricRegistry.timer(name(prefix, "trace-requests"));
        this.connectRequests = metricRegistry.timer(name(prefix, "connect-requests"));
        this.moveRequests = metricRegistry.timer(name(prefix, "move-requests"));
        this.otherRequests = metricRegistry.timer(name(prefix, "other-requests"));

        this.listener = new AsyncListener() {
            @Override
            public void onTimeout(AsyncEvent event) throws IOException {
                asyncTimeouts.mark();
            }
View Full Code Here


    final AsyncContext asyncContext = request.startAsync();
    asyncContext.setTimeout(60000);
    queue.setTimeout(65000);
    writer = new OutputStreamWriteAdapter(asyncContext.getResponse().getOutputStream());

    asyncContext.addListener(new AsyncListener() {
        @Override
        public void onComplete(final AsyncEvent event) throws IOException {
          clearActivationCallback(queue);
        }
View Full Code Here

        @Override
        protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
            // step 1 - start async
            AsyncContext actx = req.startAsync();
            actx.setTimeout(Long.MAX_VALUE);
            actx.addListener(new AsyncListener() {

                @Override
                public void onTimeout(AsyncEvent event) throws IOException {
                    log.info("onTimeout");
View Full Code Here

        @Override
        protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
            // step 1 - start async
            AsyncContext actx = req.startAsync();
            actx.setTimeout(Long.MAX_VALUE);
            actx.addListener(new AsyncListener() {

                @Override
                public void onTimeout(AsyncEvent event) throws IOException {
                    log.info("onTimeout");
View Full Code Here

  public Object suspend(final CometServletResponseImpl response, CometSessionImpl session, HttpServletRequest request) throws IOException {
    assert Thread.holdsLock(response);
    assert session == null || !Thread.holdsLock(session);
    response.flush();
    AsyncContext asyncContext = request.startAsync();
    asyncContext.addListener(new AsyncListener() {
     
      @Override
      public void onStartAsync(AsyncEvent e) throws IOException {
      }
     
View Full Code Here

   
     // 2.0 set the timeout
     ctx.setTimeout(0);
    
     // 3.0 add listener
     ctx.addListener(new AsyncListener() {
   
         @Override
      public void onTimeout(AsyncEvent arg0) throws IOException {
        System.out.println("onTimeout...");       
      }
View Full Code Here

    } else {
      asyncContext.setTimeout(HARD_TIMEOUT_SEC*1000);
      logger.debug("event=set_default_timeout secs=" + CMBProperties.getInstance().getCMBRequestTimeoutSec());
    }

    asyncContext.addListener(new AsyncListener() {

      @Override
      public void onComplete(AsyncEvent asyncEvent) throws IOException {

        AsyncContext asyncContext = asyncEvent.getAsyncContext();
View Full Code Here

        this.traceRequests = metricRegistry.timer(name(prefix, "trace-requests"));
        this.connectRequests = metricRegistry.timer(name(prefix, "connect-requests"));
        this.moveRequests = metricRegistry.timer(name(prefix, "move-requests"));
        this.otherRequests = metricRegistry.timer(name(prefix, "other-requests"));

        this.listener = new AsyncListener() {
            @Override
            public void onTimeout(AsyncEvent event) throws IOException {
                asyncTimeouts.mark();
            }
View Full Code Here

        {
            if (endp!=null)
            {
                if (_applyToAsync && request.isAsyncStarted())
                {
                    request.getAsyncContext().addListener(new AsyncListener()
                    {
                        @Override
                        public void onTimeout(AsyncEvent event) throws IOException
                        {                           
                        }
View Full Code Here

    }

    @Override
    public void addListener(final AsyncListener listener, final ServletRequest request, final ServletResponse response)
    {
        AsyncListener wrap = new AsyncListener()
        {
            @Override
            public void onTimeout(AsyncEvent event) throws IOException
            {
                listener.onTimeout(new AsyncEvent(event.getAsyncContext(),request,response,event.getThrowable()));
View Full Code Here

TOP

Related Classes of javax.servlet.AsyncListener

Copyright © 2018 www.massapicom. 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.