Seems, while I was sleeping, you guys found some w...
# announcements
c
Seems, while I was sleeping, you guys found some way to solve the problem we were talking about 🙂 My idea was to implement visitor:
Copy code
class Projector {
    fun <T:LoanTransactionEvent> handle(event: T) {
        event.handleWith(this)
    }
}

interface LoanTransactionEvent {
    default void handleWith(Projector projector) {
        // your event-specific stuff here
    }
}
And now you can call it in the loop exactly as @snowe wanted. (I was too lazy to test, so there may be some mechanical errors).
s
czar: I don't think is going to work. Axon works by using the
@EventHandler
annotation to find methods that might handle events. then it uses a parameter resolver to find if the event fires any of the methods. Since almost all of our events inherit from
LoanTransactionEvent
this would fire for every event instead of just the few events I want it to fire for. 😕
c
Oh, it's been a while since I've played with Axon, missed that you were using it. Good luck then 🙂