Package org.apache.cxf.continuations

Examples of org.apache.cxf.continuations.Continuation.suspend()


                       
                        // Now we don't set up the timeout value
                        LOG.trace("Suspending continuation of exchangeId: {}", camelExchange.getExchangeId());
                        // TODO Support to set the timeout in case the Camel can't send the response back on time.
                        // The continuation could be called before the suspend is called
                        continuation.suspend(0);

                        // use the asynchronous API to process the exchange
                        getAsyncProcessor().process(camelExchange, new AsyncCallback() {
                            public void done(boolean doneSync) {
                                // make sure the continuation resume will not be called before the suspend method in other thread
View Full Code Here


                                          + camelExchange.getExchangeId());
                            }
                            // The continuation could be called before the
                            // suspend
                            // is called
                            continuation.suspend(0);
                        } else {
                            // just set the response back, as the invoking
                            // thread is
                            // not changed
                            if (LOG.isTraceEnabled()) {
View Full Code Here

                    ContinuationProvider p = (ContinuationProvider)
                        getContext().getMessageContext().get(ContinuationProvider.class.getName());
                    Continuation c = p.getContinuation();
                    if (c.isNew()) {
                        if (cnt < 0) {
                            c.suspend(-cnt);
                        } else {
                            c.suspend(2000 - (cnt % 1000));
                        }
                        return null;
                    }
View Full Code Here

                    Continuation c = p.getContinuation();
                    if (c.isNew()) {
                        if (cnt < 0) {
                            c.suspend(-cnt);
                        } else {
                            c.suspend(2000 - (cnt % 1000));
                        }
                        return null;
                    }
                    return "Hello, finally! " + cnt;
                }
View Full Code Here

            ContinuationProvider contProvider =
                (ContinuationProvider) messageContext.get(ContinuationProvider.class.getName());
            final Continuation continuation = contProvider.getContinuation();
           
            if (continuation.isNew()) {
                continuation.suspend(5000);
                new Thread(new Runnable() {
                    public void run() {
                        try {
                            continuation.resume();
                        } catch (Exception e) {
View Full Code Here

                    throw new RuntimeException("Was already suspended");
                }
                Object userObject = "Fred".equals(name) ? "Ruby" : null;
                continuation.setObject(userObject);
                suspended = true;
                continuation.suspend(2000);
            } else {
                if (!suspended) {
                    throw new RuntimeException("Was not suspended yet");
                }
                if (continuation.isResumed()) {
View Full Code Here

            ContinuationProvider contProvider =
                (ContinuationProvider) messageContext.get(ContinuationProvider.class.getName());
            final Continuation continuation = contProvider.getContinuation();
           
            if (continuation.isNew()) {
                continuation.suspend(5000);
                new Thread(new Runnable() {
                    public void run() {
                        try {
                            continuation.resume();
                        } catch (Exception e) {
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.