All Downloads are FREE. Search and download functionalities are using the official Maven repository.

co.com.sofka.infraestructure.controller.CommandController Maven / Gradle / Ivy

There is a newer version: 1.5.0
Show newest version
package co.com.sofka.infraestructure.controller;


import co.com.sofka.domain.generic.Command;
import co.com.sofka.infraestructure.bus.CommandBus;
import co.com.sofka.infraestructure.handle.HandlerExecutionError;

/**
 * The type Command controller.
 */
public abstract class CommandController {
    private final CommandBus commandBus;

    /**
     * Instantiates a new Command controller.
     *
     * @param commandBus the command bus
     */
    public CommandController(CommandBus commandBus) {
        this.commandBus = commandBus;
    }

    /**
     * Dispatch.
     *
     * @param command the command
     * @throws HandlerExecutionError the handler execution error
     */
    protected void dispatch(Command command) throws HandlerExecutionError {
        commandBus.dispatch(command);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy