public static interface JpaReadSide.ReadSideHandlerBuilder<Event extends AggregateEvent<Event>>
Modifier and Type | Method and Description |
---|---|
ReadSideProcessor.ReadSideHandler<Event> |
build()
Build the read side handler.
|
<E extends Event> |
setEventHandler(Class<E> eventClass,
BiConsumer<javax.persistence.EntityManager,E> handler)
Define the event handler that will be used for events of a given class.
|
JpaReadSide.ReadSideHandlerBuilder<Event> |
setGlobalPrepare(Consumer<javax.persistence.EntityManager> callback)
Set a global prepare callback.
|
JpaReadSide.ReadSideHandlerBuilder<Event> |
setPrepare(BiConsumer<javax.persistence.EntityManager,AggregateEventTag<Event>> callback)
Set a prepare callback.
|
JpaReadSide.ReadSideHandlerBuilder<Event> setGlobalPrepare(Consumer<javax.persistence.EntityManager> callback)
callback
- The callback.ReadSideProcessor.ReadSideHandler.globalPrepare()
JpaReadSide.ReadSideHandlerBuilder<Event> setPrepare(BiConsumer<javax.persistence.EntityManager,AggregateEventTag<Event>> callback)
callback
- The callback.ReadSideProcessor.ReadSideHandler.prepare(AggregateEventTag)
<E extends Event> JpaReadSide.ReadSideHandlerBuilder<Event> setEventHandler(Class<E> eventClass, BiConsumer<javax.persistence.EntityManager,E> handler)
eventClass
- The event class to handle.handler
- The function to handle the events.ReadSideProcessor.ReadSideHandler<Event> build()