public void resetEventBuses() { for (ResettableEventBus resettableEventBus : resettableEventBuses) { resettableEventBus.reset(); } } }
@Override protected void after() { this.eventBus.reset(); } }
private void releaseEventHandlers(UiContextReference relatedContextReference, BeanStore store) { // First - resolve the scope corresponding to the bean store that is being destroyed final Scope destroyedScope = getAllUiScopes().getScope(relatedContextReference.getAnnotation().getRelatedScopeAnnotation(true)); // If that scope is the one that is wrapped - take all the resettable event buses stored in that bean store and reset them, // which will effectively remove the handlers related to the UI context that is currently being destroyed // (see class JavaDoc which explains how the event buses get wrapped). if (Objects.equals(getOriginalScope(), destroyedScope)) { store.forEach((key, value) -> { if (value instanceof ResettableEventBus) { ((ResettableEventBus) value).reset(); } }); } }
eventBus.reset();