Package org.axonframework.commandhandling.callbacks

Examples of org.axonframework.commandhandling.callbacks.FutureCallback


    @RemotingInclude
    @Override
    public Object sendCommand(Object command) {
        logger.debug("Received a command of type : {}", command.getClass().getSimpleName());
        FutureCallback callback = new FutureCallback();
        commandBus.dispatch(new GenericCommandMessage<Object>(command), callback);
        try {
            return callback.get();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here


        waitForConnectorSync();

        FutureCallback<Object> callback1 = new FutureCallback<Object>();
        connector1.send("1", new GenericCommandMessage<Object>("Hello"), callback1);
        FutureCallback<?> callback2 = new FutureCallback();
        connector1.send("1", new GenericCommandMessage<Object>(1L), callback2);

        FutureCallback<Object> callback3 = new FutureCallback<Object>();
        connector2.send("1", new GenericCommandMessage<String>("Hello"), callback3);
        FutureCallback<?> callback4 = new FutureCallback();
        connector2.send("1", new GenericCommandMessage<Long>(1L), callback4);

        assertEquals("The Reply!", callback1.get());
        assertEquals("The Reply!", callback2.get());
        assertEquals("The Reply!", callback3.get());
        assertEquals("The Reply!", callback4.get());

        assertTrue(connector1.getConsistentHash().equals(connector2.getConsistentHash()));
    }
View Full Code Here

TOP

Related Classes of org.axonframework.commandhandling.callbacks.FutureCallback

Copyright © 2018 www.massapicom. 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.