@Test public void destroy_beanImplementingMultipleActivitiListeners_correctlyRemoved() { workflowTaskRegistrar.destroy(); verify(workflowTaskRegistry).unregisterExecutionListener(BEAN_ID_LISTENER); verify(workflowTaskRegistry).unregisterTaskListener(BEAN_ID_LISTENER); }
@Override public void destroy() { for (Class<?> type : workflowDelegateTypes()) { Map<String, ?> delegates = applicationContext.getBeansOfType(type); delegates.forEach((name, bean) -> { activitiBeanRegistry.remove(name); logger.debug("unregistered Bundle component {} (type: {}) -> {}", name, type, bean); if (JavaDelegate.class.equals(type)) { this.workflowTaskRegistry.unregisterDelegate(name); } else if (TaskListener.class.equals(type)) { this.workflowTaskRegistry.unregisterTaskListener(name); } else if (ExecutionListener.class.equals(type)) { this.workflowTaskRegistry.unregisterExecutionListener(name); } }); } }
WorkflowTaskRegistrar implements InitializingBean, ApplicationContextAware, DisposableBean { @Override public void destroy() { for (Class<?> type : workflowDelegateTypes()) { Map<String, ?> delegates = applicationContext.getBeansOfType(type); delegates.forEach((name, bean) -> { activitiBeanRegistry.remove(name); logger.debug("unregistered Bundle component {} (type: {}) -> {}", name, type, bean); if (JavaDelegate.class.equals(type)) { this.workflowTaskRegistry.unregisterDelegate(name); } else if (TaskListener.class.equals(type)) { this.workflowTaskRegistry.unregisterTaskListener(name); } else if (ExecutionListener.class.equals(type)) { this.workflowTaskRegistry.unregisterExecutionListener(name); } }); } } }
WorkflowTaskRegistrar implements InitializingBean, ApplicationContextAware, DisposableBean { @Override public void destroy() { for (Class<?> type : workflowDelegateTypes()) { Map<String, ?> delegates = applicationContext.getBeansOfType(type); delegates.forEach((name, bean) -> { activitiBeanRegistry.remove(name); logger.debug("unregistered Bundle component {} (type: {}) -> {}", name, type, bean); if (JavaDelegate.class.equals(type)) { this.workflowTaskRegistry.unregisterDelegate(name); } else if (TaskListener.class.equals(type)) { this.workflowTaskRegistry.unregisterTaskListener(name); } else if (ExecutionListener.class.equals(type)) { this.workflowTaskRegistry.unregisterExecutionListener(name); } }); } } WorkflowTaskRegistrar(@NotNull Map<String, Object> activitiBeanRegistry,
            @NotNull WorkflowTaskRegistry workflowTaskRegistry); }
WorkflowTaskRegistrar implements InitializingBean, ApplicationContextAware, DisposableBean { @Override public void destroy() { for (Class<?> type : workflowDelegateTypes()) { Map<String, ?> delegates = applicationContext.getBeansOfType(type); delegates.forEach((name, bean) -> { activitiBeanRegistry.remove(name); logger.debug("unregistered Bundle component {} (type: {}) -> {}", name, type, bean); if (JavaDelegate.class.equals(type)) { this.workflowTaskRegistry.unregisterDelegate(name); } else if (TaskListener.class.equals(type)) { this.workflowTaskRegistry.unregisterTaskListener(name); } else if (ExecutionListener.class.equals(type)) { this.workflowTaskRegistry.unregisterExecutionListener(name); } }); } } WorkflowTaskRegistrar(@NotNull Map<String, Object> activitiBeanRegistry,
            @NotNull WorkflowTaskRegistry workflowTaskRegistry); @Override void afterPropertiesSet(); @Override void destroy(); @Override void setApplicationContext(@NotNull ApplicationContext applicationContext); @NotNull final Map getActivitiBeanRegistry(); @NotNull final WorkflowTaskRegistry getWorkflowTaskRegistry(); }
WorkflowTaskRegistrar implements InitializingBean, ApplicationContextAware, DisposableBean { @Override public void destroy() { for (Class<?> type : workflowDelegateTypes()) { Map<String, ?> delegates = applicationContext.getBeansOfType(type); delegates.forEach((name, bean) -> { activitiBeanRegistry.remove(name); logger.debug("unregistered Bundle component {} (type: {}) -> {}", name, type, bean); if (JavaDelegate.class.equals(type)) { this.workflowTaskRegistry.unregisterDelegate(name); } else if (TaskListener.class.equals(type)) { this.workflowTaskRegistry.unregisterTaskListener(name); } else if (ExecutionListener.class.equals(type)) { this.workflowTaskRegistry.unregisterExecutionListener(name); } }); } } WorkflowTaskRegistrar(@NotNull Map<String, Object> activitiBeanRegistry,
            @NotNull WorkflowTaskRegistry workflowTaskRegistry); @Override void afterPropertiesSet(); @Override void destroy(); @Override void setApplicationContext(@NotNull ApplicationContext applicationContext); @NotNull final Map getActivitiBeanRegistry(); @NotNull final WorkflowTaskRegistry getWorkflowTaskRegistry();  }