Class AbstractCommandBus

    • Method Detail

      • hasInterceptor

        public boolean hasInterceptor​(CommandBusInterceptor interceptor)
        Description copied from interface: CommandBus
        Guard method to test if the CommandBus already contains the interceptor
        Specified by:
        hasInterceptor in interface CommandBus
        Parameters:
        interceptor - the interceptor to check
        Returns:
        true if the CommandBus already contains the interceptor, otherwise false
      • addCommandHandler

        public CommandBus addCommandHandler​(CommandHandler commandHandler)
        Description copied from interface: CommandBus
        Add a new command handler.
        Specified by:
        addCommandHandler in interface CommandBus
        Parameters:
        commandHandler - the command handler to add
        Returns:
        this bus instance
      • send

        public <R,​C> R send​(C command)
        Description copied from interface: CommandBus
        The send command synchronously and process the command on the sending thread
        Specified by:
        send in interface CommandBus
        Type Parameters:
        R - the return type
        C - the command type
        Parameters:
        command - the command to send
        Returns:
        the result of the command processing (if any)
      • sendAsync

        public <R,​C> reactor.core.publisher.Mono<R> sendAsync​(C command)
        Description copied from interface: CommandBus
        The send command asynchronously and process the command on a Schedulers.boundedElastic() thread
        Specified by:
        sendAsync in interface CommandBus
        Type Parameters:
        R - the return type
        C - the command type
        Parameters:
        command - the command to send
        Returns:
        a Mono that will contain the result of the command processing (if any)
      • hasCommandHandler

        public boolean hasCommandHandler​(CommandHandler commandHandler)
        Description copied from interface: CommandBus
        Guard method to test if the CommandBus already contains the commandHandler
        Specified by:
        hasCommandHandler in interface CommandBus
        Parameters:
        commandHandler - the commandHandler to check
        Returns:
        true if the CommandBus already contains the commandHandler, otherwise false