@Override public void initialise() throws InitialisationException { Map<String, Class<? extends Notification>> eventMap = new HashMap<>(EVENT_MAP); Map<String, Class<? extends NotificationListener>> interfaceMap = new HashMap<>(INTERFACE_MAP); ServerNotificationManager notificationManager = populateNotificationTypeMappings(eventMap, interfaceMap); enableNotifications(notificationManager, eventMap, interfaceMap); disableNotifications(notificationManager, eventMap, interfaceMap); // Merge: // i) explicitly configured notification listeners, // ii) any singleton beans defined in spring that implement NotificationListener. for (ListenerSubscriptionPair sub : getMergedListeners(notificationManager)) { // Do this to avoid warnings when the Spring context is refreshed if (!notificationManager.isListenerRegistered(sub.getListener())) { notificationManager.addListenerSubscriptionPair(sub); } else { notificationManager.removeListener(sub.getListener()); notificationManager.addListenerSubscriptionPair(sub); } } }
protected void removeNotificationListeners() { if (!muleContext.getNotificationManager().isDisposed()) { muleContext.getNotificationManager().removeListener(messageProcessorTextDebugger); muleContext.getNotificationManager().removeListener(pipelineProcessorDebugger); } }
@Override public <N extends Notification> void unregisterListener(NotificationListener<N> listener) { if (context.getNotificationManager() != null) { context.getNotificationManager().removeListener(listener); } }
@Override public void initialise() throws InitialisationException { Map<String, Class<? extends Notification>> eventMap = new HashMap<>(EVENT_MAP); Map<String, Class<? extends NotificationListener>> interfaceMap = new HashMap<>(INTERFACE_MAP); ServerNotificationManager notificationManager = populateNotificationTypeMappings(eventMap, interfaceMap); enableNotifications(notificationManager, eventMap, interfaceMap); disableNotifications(notificationManager, eventMap, interfaceMap); // Merge: // i) explicitly configured notification listeners, // ii) any singleton beans defined in spring that implement NotificationListener. for (ListenerSubscriptionPair sub : getMergedListeners(notificationManager)) { // Do this to avoid warnings when the Spring context is refreshed if (!notificationManager.isListenerRegistered(sub.getListener())) { notificationManager.addListenerSubscriptionPair(sub); } else { notificationManager.removeListener(sub.getListener()); notificationManager.addListenerSubscriptionPair(sub); } } }