Package org.eclipse.jetty.continuation

Examples of org.eclipse.jetty.continuation.Continuation.resume()


                        if (log.isTraceEnabled()) {
                            log.trace("Resuming continuation of exchangeId: {}", exchange.getExchangeId());
                        }
                        // resume processing after both, sync and async callbacks
                        continuation.setAttribute(EXCHANGE_ATTRIBUTE_NAME, exchange);
                        continuation.resume();
                    } else {
                        log.warn("Cannot resume expired continuation of exchangeId: {}", exchange.getExchangeId());
                    }
                }
            });
View Full Code Here


            }
        }
       
        Continuation continuation = ContinuationSupport.getContinuation(req.getHttpServletRequest());
        continuation.setAttribute("response", boshResponse);
        continuation.resume();
        latestWriteTimestamp = System.currentTimeMillis();
    }
   
    private boolean isResponseSavable(BoshRequest req, Stanza response) {
        // responses to pause requests are not saved
View Full Code Here

        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("BOSH writing response: {}", new String(boshResponse.getContent()));
        }
        Continuation continuation = ContinuationSupport.getContinuation(req.getHttpServletRequest());
        continuation.setAttribute("response", boshResponse);
        continuation.resume();
        close();
    }

    /*
     * Terminates the BOSH session
View Full Code Here

            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("BOSH writing response: {}", new String(boshResponse.getContent()));
            }
            Continuation continuation = ContinuationSupport.getContinuation(req.getHttpServletRequest());
            continuation.setAttribute("response", boshResponse);
            continuation.resume();
        }
       
        serverRuntimeContext.getResourceRegistry().unbindSession(this);
        sessionStateHolder.setState(SessionState.CLOSED);
       
View Full Code Here

        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("BOSH writing response: {}", new String(boshResponse.getContent()));
        }
        Continuation continuation = ContinuationSupport.getContinuation(br.getHttpServletRequest());
        continuation.setAttribute("response", boshResponse);
        continuation.resume();
        latestWriteTimestamp = System.currentTimeMillis();
    }

    private BoshResponse getBoshResponse(Stanza stanza, Long ack) {
        if (ack != null) {
View Full Code Here

        expect(boshHandler.mergeResponses(EasyMock.<Stanza> anyObject(), EasyMock.<Stanza> anyObject()))
                .andReturn(body);
        expectLastCall().times(2);

        continuation.setAttribute(eq("response"), EasyMock.<BoshResponse> anyObject());
        continuation.resume();

        mocksControl.replay();

        BoshBackedSessionContext boshBackedSessionContext = new BoshBackedSessionContext(boshHandler,
                serverRuntimeContext);
View Full Code Here

        expect(serverRuntimeContext.getServerFeatures()).andReturn(serverFeatures);
        expect(serverFeatures.getAuthenticationMethods()).andReturn(Collections.<SASLMechanism> emptyList());

        Capture<BoshResponse> captured = new Capture<BoshResponse>();
        continuation.setAttribute(eq("response"), EasyMock.<BoshResponse> capture(captured));
        continuation.resume();
        mocksControl.replay();

        Stanza boshRequest = createSessionRequest();
        boshHandler.process(httpServletRequest, boshRequest);
        mocksControl.verify();
View Full Code Here

        expect(httpServletRequest.getAttribute(Continuation.ATTRIBUTE)).andReturn(continuation);
        expectLastCall().atLeastOnce();
        continuation.setTimeout(anyLong());
        continuation.setAttribute(eq("request"), EasyMock.<BoshRequest> notNull());
        continuation.suspend();
        continuation.resume();
        continuation.addContinuationListener(EasyMock.<ContinuationListener> anyObject());
        Capture<BoshResponse> captured = new Capture<BoshResponse>();
        continuation.setAttribute(eq("response"), EasyMock.<BoshResponse> capture(captured));
        mocksControl.replay();
View Full Code Here

        expect(boshHandler.getEmptyResponse()).andReturn(body);
        expectLastCall().atLeastOnce();

        // write0
        continuation.resume();

        mocksControl.replay();
        BoshBackedSessionContext boshBackedSessionContext = new BoshBackedSessionContext(boshHandler, serverRuntimeContext);
       
        boshBackedSessionContext.insertRequest(br);
View Full Code Here

                        // we should resume the continuation now that we are done asynchronously
                        if (log.isTraceEnabled()) {
                            log.trace("Resuming continuation of exchangeId: " + exchange.getExchangeId());
                        }
                        continuation.setAttribute("CamelExchange", exchange);
                        continuation.resume();
                    }
                });

                if (!sync) {
                    // wait for the exchange to get processed.
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.