@SuppressWarnings("LeakingThisInConstructor") protected AbstractSaga(EventRouter<Void, Event> eventRouter) { Validate.notNull(eventRouter, "eventRouter must not be null"); this.eventRouter = eventRouter; eventRouter.register(this); }
/** * Invokes the handler for the given event and marks the event as handled. * * @param event the event to handle */ protected void invokeHandler(Event<?> event) { eventRouter.routeEvent(event); markedAsHandled(event); }