Examples of FutureResponse


Examples of org.apache.activemq.transport.FutureResponse

        }
    }

    public Object request(Object o) throws IOException {
        final Command command = (Command)o;
        FutureResponse response = asyncRequest(command, null);
        while (true) {
            Response result = response.getResult(requestTimeout);
            if (result != null) {
                return result;
            }
            onMissingResponse(command, response);
        }
View Full Code Here

Examples of org.apache.activemq.transport.FutureResponse

        }
    }

    public Object request(Object o, int timeout) throws IOException {
        final Command command = (Command)o;
        FutureResponse response = asyncRequest(command, null);
        while (timeout > 0) {
            int time = timeout;
            if (timeout > requestTimeout) {
                time = requestTimeout;
            }
            Response result = response.getResult(time);
            if (result != null) {
                return result;
            }
            onMissingResponse(command, response);
            timeout -= time;
        }
        return response.getResult(0);
    }
View Full Code Here

Examples of org.apache.activemq.transport.FutureResponse

        }
    }

    public Object request(Object o) throws IOException {
      final Command command = (Command) o;
        FutureResponse response = asyncRequest(command, null);
        while (true) {
            Response result = response.getResult(requestTimeout);
            if (result != null) {
                return result;
            }
            onMissingResponse(command, response);
        }
View Full Code Here

Examples of org.apache.activemq.transport.FutureResponse

        }
    }

    public Object request(Object o, int timeout) throws IOException {
      final Command command = (Command) o;
        FutureResponse response = asyncRequest(command, null);
        while (timeout > 0) {
            int time = timeout;
            if (timeout > requestTimeout) {
                time = requestTimeout;
            }
            Response result = response.getResult(time);
            if (result != null) {
                return result;
            }
            onMissingResponse(command, response);
            timeout -= time;
        }
        return response.getResult(0);
    }
View Full Code Here

Examples of org.apache.activemq.transport.FutureResponse

        // send advisory of path 2, doesn't send a ConsumerInfo to localBroker
        remoteListener.onCommand(path2Msg);
        // (2a) send a message
        localListener.onCommand(msgDispatch);
        ResponseCallback callback = (ResponseCallback) firstMessageFuture.arguments[1];
        FutureResponse response = new FutureResponse(callback);
        response.set(new Response());

        // send advisory of path 2 remove, doesn't send a RemoveInfo to localBroker
        remoteListener.onCommand(removePath2Msg);
        // (2b) send a message
        localListener.onCommand(msgDispatch);
        callback = (ResponseCallback) secondMessageFuture.arguments[1];
        response = new FutureResponse(callback);
        response.set(new Response());

        // (3) send advisory of path 1 remove, sends a RemoveInfo to localBroker
        remoteListener.onCommand(removePath1Msg);
        waitForRemove.assertHappens(5, TimeUnit.SECONDS);
        // send a message, does not send message as in 2a and 2b
View Full Code Here

Examples of org.apache.activemq.transport.FutureResponse

        // send advisory of path 2, doesn't send a ConsumerInfo to localBroker
        remoteListener.onCommand(path2Msg);
        // (2a) send a message
        localListener.onCommand(msgDispatch);
        ResponseCallback callback = (ResponseCallback) firstMessageFuture.arguments[1];
        FutureResponse response = new FutureResponse(callback);
        response.set(new Response());

        // send advisory of path 1 remove, shouldn't send a RemoveInfo to localBroker
        remoteListener.onCommand(removePath1Msg);
        // (2b) send a message, should send the message as in 2a
        localListener.onCommand(msgDispatch);
        callback = (ResponseCallback) secondMessageFuture.arguments[1];
        response = new FutureResponse(callback);
        response.set(new Response());

        // (3) send advisory of path 1 remove, should send a RemoveInfo to localBroker
        remoteListener.onCommand(removePath2Msg);
        waitForRemove.assertHappens(5, TimeUnit.SECONDS);
        // send a message, does not send message as in 2a
View Full Code Here

Examples of org.apache.activemq.transport.FutureResponse

            return holder;
        }

        public static ArgHolder holdArgsForLastFutureRequestCall() {
            final ArgHolder holder = new ArgHolder();
            EasyMock.expect(new FutureResponse(null)).andAnswer(new IAnswer<FutureResponse>() {
                @Override
                public FutureResponse answer() throws Throwable {
                    Object[] args = EasyMock.getCurrentArguments();
                    holder.arguments = Arrays.copyOf(args, args.length);
                    return null;
View Full Code Here

Examples of org.apache.activemq.transport.FutureResponse

    }

    @Override
    public Object request(Object o) throws IOException {
        final Command command = (Command)o;
        FutureResponse response = asyncRequest(command, null);
        while (true) {
            Response result = response.getResult(requestTimeout);
            if (result != null) {
                return result;
            }
            onMissingResponse(command, response);
        }
View Full Code Here

Examples of org.apache.activemq.transport.FutureResponse

    }

    @Override
    public Object request(Object o, int timeout) throws IOException {
        final Command command = (Command)o;
        FutureResponse response = asyncRequest(command, null);
        while (timeout > 0) {
            int time = timeout;
            if (timeout > requestTimeout) {
                time = requestTimeout;
            }
            Response result = response.getResult(time);
            if (result != null) {
                return result;
            }
            onMissingResponse(command, response);
            timeout -= time;
        }
        return response.getResult(0);
    }
View Full Code Here

Examples of org.apache.activemq.transport.FutureResponse

        }
    }

    public Object request(Object o) throws IOException {
        final Command command = (Command)o;
        FutureResponse response = asyncRequest(command, null);
        while (true) {
            Response result = response.getResult(requestTimeout);
            if (result != null) {
                return result;
            }
            onMissingResponse(command, response);
        }
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.