Examples of FutureResponseImpl


Examples of org.apache.james.protocols.api.future.FutureResponseImpl

        // Check if the there is a ResultHandler left to execute if not just return the response
        if (resultHandlers.hasNext()) {
            // Special handling of FutureResponse
            // See PROTOCOLS-37
            if (response instanceof FutureResponse) {
                final FutureResponseImpl futureResponse = new FutureResponseImpl();
                ((FutureResponse) response).addListener(new ResponseListener() {

                    public void onResponse(FutureResponse response) {
                        Response r = resultHandlers.next().onResponse(session, response, executionTime, cHandler);
                       
                        // call the next ResultHandler
                        r = executeResultHandlers(session, r, executionTime, cHandler, resultHandlers);
                       
                        // notify the FutureResponse that we are ready
                        futureResponse.setResponse(r);
                    }
                });
               
                // just return the new FutureResponse which will get notified once its ready
                return futureResponse;
View Full Code Here

Examples of org.apache.james.protocols.api.future.FutureResponseImpl

   
    @Test
    public void testWriteOrderFutureResponseAllReady() throws InterruptedException, UnsupportedEncodingException {
        final List<Response> messages = new ArrayList<Response>();
        for (int i = 0; i < 2000; i++) {
                FutureResponseImpl r = new FutureResponseImpl();
                r.setResponse(new TestResponse());
                messages.add(r);
        }
        checkWrittenResponses(messages);
    }
View Full Code Here

Examples of org.apache.james.protocols.api.future.FutureResponseImpl

      
    @Test
    public void testWriteOrderFutureResponse() throws InterruptedException, UnsupportedEncodingException {
        final List<Response> messages = new ArrayList<Response>();
        for (int i = 0; i < 2000; i++) {
            messages.add(new FutureResponseImpl());
        }
        notifyFutureResponses(messages, false);

       
        checkWrittenResponses(messages);
View Full Code Here

Examples of org.apache.james.protocols.api.future.FutureResponseImpl

    @Test
    public void testWriteOrderFutureResponseReverseNotify() throws InterruptedException, UnsupportedEncodingException {
        final List<Response> messages = new ArrayList<Response>();
        for (int i = 0; i < 2000; i++) {
            messages.add(new FutureResponseImpl());
        }
        notifyFutureResponses(messages, true);

        checkWrittenResponses(messages);
    }
View Full Code Here

Examples of org.apache.james.protocols.api.future.FutureResponseImpl

        final List<Response> messages = new ArrayList<Response>();
        for (int i = 0; i < 2000; i++) {
            if (i % 2 == 0) {
                messages.add(new TestResponse());
            } else {
                messages.add(new FutureResponseImpl());
            }

        }
        notifyFutureResponses(messages, false);
       
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.