/** * Dispatches a command without callback. When dispatching fails, since there is no callback, the command will * <em>not</em> be retried. * * @param command The command to dispatch */ protected void sendAndForget(Object command) { if (retryScheduler == null) { commandBus.dispatch(processInterceptors(asCommandMessage(command))); } else { CommandMessage<?> commandMessage = asCommandMessage(command); send(commandMessage, LoggingCallback.INSTANCE); } }
@Override public Registration registerDispatchInterceptor( MessageDispatchInterceptor<? super CommandMessage<?>> dispatchInterceptor) { return super.registerDispatchInterceptor(dispatchInterceptor); }
@Override public <C, R> void send(C command, CommandCallback<? super C, ? super R> callback) { super.send(command, callback); }
/** * Sends the given {@code command}, and invokes the {@code callback} when the command is processed. * * @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 <C, R> void send(C command, CommandCallback<? super C, ? super R> callback) { CommandMessage<? extends C> commandMessage = processInterceptors(asCommandMessage(command)); CommandCallback<? super C, ? super R> commandCallback = callback; if (retryScheduler != null) { commandCallback = new RetryingCallback<>(callback, retryScheduler, commandBus); } commandBus.dispatch(commandMessage, commandCallback); }
@Override public <C, R> void send(C command, CommandCallback<? super C, R> callback) { super.send(command, callback); }
/** * Sends the given {@code command}, and invokes the {@code callback} when the command is processed. * * @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 <C, R> void send(C command, CommandCallback<? super C, R> callback) { CommandMessage<? extends C> commandMessage = processInterceptors(asCommandMessage(command)); CommandCallback<? super C, R> commandCallback = callback; if (retryScheduler != null) { commandCallback = new RetryingCallback<>(callback, retryScheduler, commandBus); } commandBus.dispatch(commandMessage, commandCallback); }
/** * Dispatches a command without callback. When dispatching fails, since there is no callback, the command will * <em>not</em> be retried. * * @param command The command to dispatch */ protected void sendAndForget(Object command) { if (retryScheduler == null) { commandBus.dispatch(processInterceptors(asCommandMessage(command))); } else { CommandMessage<?> commandMessage = asCommandMessage(command); send(commandMessage, LoggingCallback.INSTANCE); } }
@Override public <C, R> void send(C command, CommandCallback<? super C, ? super R> callback) { super.send(command, callback); }
/** * Sends the given {@code command}, and invokes the {@code callback} when the command is processed. * * @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 <C, R> void send(C command, CommandCallback<? super C, ? super R> callback) { CommandMessage<? extends C> commandMessage = processInterceptors(asCommandMessage(command)); CommandCallback<? super C, ? super R> commandCallback = callback; if (retryScheduler != null) { commandCallback = new RetryingCallback<>(callback, retryScheduler, commandBus); } commandBus.dispatch(commandMessage, commandCallback); }
@Override public Registration registerDispatchInterceptor( MessageDispatchInterceptor<? super CommandMessage<?>> dispatchInterceptor) { return super.registerDispatchInterceptor(dispatchInterceptor); }
/** * Dispatches a command without callback. When dispatching fails, since there is no callback, the command will * <em>not</em> be retried. * * @param command The command to dispatch */ protected void sendAndForget(Object command) { if (retryScheduler == null) { commandBus.dispatch(processInterceptors(asCommandMessage(command))); } else { CommandMessage<?> commandMessage = asCommandMessage(command); send(commandMessage, LoggingCallback.INSTANCE); } }