adamsaghy commented on code in PR #5436:
URL: https://github.com/apache/fineract/pull/5436#discussion_r2764328238
##########
fineract-command/src/main/java/org/apache/fineract/command/implementation/SynchronousCommandExecutor.java:
##########
@@ -18,37 +18,41 @@
*/
package org.apache.fineract.command.implementation;
-import java.util.List;
import java.util.function.Supplier;
-import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.fineract.command.core.Command;
-import org.apache.fineract.command.core.CommandExecutor;
+import org.apache.fineract.command.core.CommandAuditor;
import org.apache.fineract.command.core.CommandHandler;
-import org.apache.fineract.command.core.CommandMiddleware;
import org.apache.fineract.command.core.CommandRouter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;
@Slf4j
-@RequiredArgsConstructor
@Component
@ConditionalOnProperty(value = "fineract.command.executor", havingValue =
"sync")
@SuppressWarnings({ "unchecked" })
-public class SynchronousCommandExecutor implements CommandExecutor {
+public class SynchronousCommandExecutor extends BaseCommandExecutor {
- private final List<CommandMiddleware> middlewares;
-
- private final CommandRouter router;
+ public SynchronousCommandExecutor(CommandRouter router, CommandAuditor
auditor) {
+ super(router, auditor);
+ }
@Override
- public <REQ, RES> Supplier<RES> execute(Command<REQ> command) {
- for (CommandMiddleware middleware : middlewares) {
- middleware.invoke(command);
- }
-
+ public <REQ, RES> Supplier<RES> execute(final Command<REQ> command) {
CommandHandler<REQ, RES> handler = router.route(command);
- return () -> handler.handle(command);
+ return () -> {
Review Comment:
I think our transaction boundary is not correct at the moment. The execution
result most be bound to the audit entries.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]