Package org.axonframework.commandhandling

Examples of org.axonframework.commandhandling.CommandMessage


     * @param command  The command to dispatch
     * @param callback The callback to notify with the processing result
     * @param <R>      The type of response expected from the command
     */
    protected <R> void send(Object command, CommandCallback<R> callback) {
        CommandMessage commandMessage = processInterceptors(createCommandMessage(command));
        CommandCallback<R> commandCallback = callback;
        if (retryScheduler != null) {
            commandCallback = new RetryingCallback<R>(callback, commandMessage, retryScheduler, commandBus);
        }
        commandBus.dispatch(commandMessage, commandCallback);
View Full Code Here


     *
     * @param commandMessage The incoming command message
     * @return The command message to dispatch
     */
    protected CommandMessage processInterceptors(CommandMessage commandMessage) {
        CommandMessage message = commandMessage;
        for (CommandDispatchInterceptor dispatchInterceptor : dispatchInterceptors) {
            message = dispatchInterceptor.handle(message);
        }
        return message;
    }
View Full Code Here

                    }
                });
        testSubject.dispatch(new GenericCommandMessage<CreateCommand>(new CreateCommand(aggregateIdentifier)));
        CommandCallback mockCallback = mock(CommandCallback.class);
        for (int t = 0; t < 1000; t++) {
            CommandMessage command;
            if (t % 100 == 10) {
                command = errorCommand;
            } else {
                command = new GenericCommandMessage<StubCommand>(new StubCommand(aggregateIdentifier));
            }
View Full Code Here

            testSubject.dispatch(new GenericCommandMessage<CreateCommand>(new CreateCommand(aggregateIdentifier[a])));
        }
        CommandCallback mockCallback = mock(CommandCallback.class);
        for (int t = 0; t < COMMAND_COUNT; t++) {
            for (int a = 0; a < AGGREGATE_COUNT; a++) {
                CommandMessage command;
                if (t == 10) {
                    command = new GenericCommandMessage<ErrorCommand>(new ErrorCommand(aggregateIdentifier[a]));
                } else {
                    command = new GenericCommandMessage<StubCommand>(new StubCommand(aggregateIdentifier[a]));
                }
View Full Code Here

            }
        }

        private void processDispatchMessage(final Message msg, final DispatchMessage message) {
            try {
                final CommandMessage commandMessage = message.getCommandMessage(serializer);
                if (message.isExpectReply()) {
                    localSegment.dispatch(commandMessage, new ReplyingCallback(msg, commandMessage));
                } else {
                    localSegment.dispatch(commandMessage);
                }
View Full Code Here

TOP

Related Classes of org.axonframework.commandhandling.CommandMessage

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.