Package org.mortbay.util.ajax

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


            }
        } else {
            String id = (String) request.getAttribute(MessageExchange.class.getName());
            exchange = (MessageExchange) exchanges.remove(id);
            request.removeAttribute(MessageExchange.class.getName());
            boolean result = cont.suspend(0);
            // Check if this is a timeout
            if (exchange == null) {
                throw new IllegalStateException("Exchange not found");
            }
            if (!result) {
View Full Code Here


        EasyMock.expectLastCall();
        c.reset();
        EasyMock.expectLastCall();
        c.resume();
        EasyMock.expectLastCall();
        c.suspend(100);
        EasyMock.expectLastCall().andReturn(true);
        EasyMock.replay(c);
       
        HttpServletRequest request = EasyMock.createMock(HttpServletRequest.class);
        request.getAttribute("org.mortbay.jetty.ajax.Continuation");
View Full Code Here

                if (!sync) {
                    // Wait for the exchange to get processed.
                    // This might block until it completes or it might return via an exception and
                    // then this method is re-invoked once the the exchange has finished processing
                    continuation.suspend(0);
                }

                // HC: The getBinding() is interesting because it illustrates the
                // impedance miss-match between HTTP's stream oriented protocol, and
                // Camels more message oriented protocol exchanges.
View Full Code Here

        }
       
        if (request.getParameter("continue")!=null)
        {
            Continuation continuation = ContinuationSupport.getContinuation(request, null);
            continuation.suspend(Long.parseLong(request.getParameter("continue")));
        }
           
        request.setAttribute("Dump", this);
        getServletContext().setAttribute("Dump",this);
        // getServletContext().log("dump "+request.getRequestURI());
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

                if (!sync) {

                    // Wait for the exchange to get processed.
                    // This might block until it completes or it might return via an exception and
                    // then this method is re-invoked once the the exchange has finished processing
                    continuation.suspend(0);

                }

                // HC: The getBinding() is interesting because it illustrates the
                // impedance miss-match between
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

                                cont.resume();
                            }
                        });

                        if (!queue.messagesWaiting()) {
                            cont.suspend(45 * 1000);
                        }
                    } else {
                        queue.setActivationCallback(null);
                    }

View Full Code Here

      synchronized (queue.getActivationLock()) {
        if (wait) {
          final Continuation cont = ContinuationSupport.getContinuation(httpServletRequest, queue);
          if (!cont.isResumed() && !queue.messagesWaiting()) {
            queue.setActivationCallback(new JettyQueueActivationCallback(cont));
            cont.suspend(45 * 1000);
            return;
          }
        }

        pollQueue(queue, stream, httpServletResponse);
View Full Code Here

                // register this continuation with our listener.
                listener.setContinuation(continuation);

                // Get the continuation object (may wait and/or retry
                // request here).
                continuation.suspend(timeout);
            }
            listener.setContinuation(null);

            // prepare the responds
            response.setContentType("text/xml");
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.