Package org.mortbay.util.ajax

Examples of org.mortbay.util.ajax.Continuation.suspend()


                if (suspend_for>=0)
                {
                    try
                    {
                        if (suspend_for>0)
                            continuation.suspend(suspend_for);
                        else
                            continuation.suspend(100L);
                    }
                    finally
                    {
View Full Code Here


                    try
                    {
                        if (suspend_for>0)
                            continuation.suspend(suspend_for);
                        else
                            continuation.suspend(100L);
                    }
                    finally
                    {

                        if (complete_after>0)
View Full Code Here

                    // insert a delay before throttling the request
                    if (_insertHeaders)
                        ((HttpServletResponse)response).addHeader("DoSFilter","delayed");
                    Continuation continuation = ContinuationSupport.getContinuation((HttpServletRequest)request,this);
                    request.setAttribute(__TRACKER,tracker);
                    continuation.suspend(_delayMs);
                    // can fall through if this was a waiting continuation
                }
            }
        }
View Full Code Here

                        ((HttpServletResponse)response).addHeader("DoSFilter","throttled");
                    synchronized (this)
                    {
                        _queue[priority].add(continuation);
                        continuation.reset();
                        if(continuation.suspend(_throttleMs))
                        {
                            // handle waiting continuation strangeness
                            // continuation was waiting and was resumed.
                            _passes.acquire();
                            accepted = true;
View Full Code Here

                    suspended=Boolean.TRUE;
                    request.setAttribute(_suspended,suspended);
                    synchronized (_queue)
                    {
                        _queue[priority].add(continuation);
                        continuation.suspend(_suspendMs);
                        // may fall through here if waiting continuation
                    }
                }
            }
            
View Full Code Here

                    {}
                }
                else
                {
                    member.setContinuation(continuation);
                    continuation.suspend(timeoutMS);
                }
            }
           
            if (member.getContinuation()==continuation)
                member.setContinuation(null);
View Full Code Here

           
            if (!continuation.isPending())
                begin(request,response);
           
            Integer timeout=(Integer)request.getAttribute("org.apache.tomcat.comet.timeout");
            boolean resumed=continuation.suspend(timeout==null?60000:timeout.intValue());
           
            if (!resumed)
                error(request,response);
        }
    }
View Full Code Here

        if (request.getParameter("continue")!=null)
        {
            try
            {
                Continuation continuation = ContinuationSupport.getContinuation(request, null);
                continuation.suspend(Long.parseLong(request.getParameter("continue")));
            }
            catch(Exception e)
            {
                throw new ServletException(e);
            }
View Full Code Here

       
        if (request.getParameter("stream")!=null)
        {
            pout.flush();
            Continuation continuation = ContinuationSupport.getContinuation(request, null);
            continuation.suspend(Long.parseLong(request.getParameter("stream")));
        }

        String lines= request.getParameter("lines");
        if (lines!=null)
        {
View Full Code Here

        synchronized (queue.getActivationLock()) {
          final Continuation cont = ContinuationSupport.getContinuation(httpServletRequest, queue);

          if (!cont.isResumed() && !queue.messagesWaiting()) {
            queue.setActivationCallback(new JettyQueueActivationCallback(cont));
            if (cont.suspend(30 * 1000)) {
              return;
            }
          }
        }
      }
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.