public static void safeClose(DiscoverableNotifier notifier, List<Exception> errors) { try { notifier.close(); } catch (RuntimeException e) { LOGGER.debug("Error closing {}.", notifier, e); errors.add(e); } }
public static void safeInit(DiscoverableNotifier notifier, List<Exception> errors) { try { notifier.init(); } catch (RuntimeException e) { LOGGER.debug("Error initializing {}.", notifier, e); errors.add(e); } }
@Override public boolean isPersistent() { if (notifyWithSecondaryNotifiers) { boolean result = primary.isPersistent(); for (DiscoverableNotifier notifier : secondary) { result |= notifier.isPersistent(); } return result; } return primary.isPersistent(); }
private DiscoverableNotifier defaultNotifier(Properties properties) { Set<DiscoverableNotifier> all = provider.available(properties, application); for (DiscoverableNotifier candidate : all) { boolean isAvailable = candidate.tryInit(); LOGGER.debug("{} is available ? {}.", candidate, isAvailable); if (isAvailable) { return candidate; } } return DoNothingNotifier.doNothing(); }
private static void safeSend(DiscoverableNotifier notifier, Notification notification, List<Exception> errors) { try { notifier.send(notification); } catch (RuntimeException e) { LOGGER.debug("Error sending notification {} with {}.", notification, notifier, e); errors.add(e); } }
private DiscoverableNotifier defaultNotifier(Properties properties) { Set<DiscoverableNotifier> all = provider.available(properties, application); for (DiscoverableNotifier candidate : all) { boolean isAvailable = candidate.tryInit(); LOGGER.debug("{} is available ? {}.", candidate, isAvailable); if (isAvailable) { return candidate; } } return DoNothingNotifier.doNothing(); }
private static void safeSend(DiscoverableNotifier notifier, Notification notification, List<Exception> errors) { try { notifier.send(notification); } catch (RuntimeException e) { LOGGER.debug("Error sending notification {} with {}.", notification, notifier, e); errors.add(e); } }
public static void safeInit(DiscoverableNotifier notifier, List<Exception> errors) { try { notifier.init(); } catch (RuntimeException e) { LOGGER.debug("Error initializing {}.", notifier, e); errors.add(e); } }
public static void safeClose(DiscoverableNotifier notifier, List<Exception> errors) { try { notifier.close(); } catch (RuntimeException e) { LOGGER.debug("Error closing {}.", notifier, e); errors.add(e); } }
@Override public boolean isPersistent() { if (notifyWithSecondaryNotifiers) { boolean result = primary.isPersistent(); for (DiscoverableNotifier notifier : secondary) { result |= notifier.isPersistent(); } return result; } return primary.isPersistent(); }
/** * Build a {@link fr.jcgay.notification.Notifier}. * * @return notifier based on provided configuration. */ public Notifier initNotifier() { return chooseNotifier().init(); }
/** * Build a {@link fr.jcgay.notification.Notifier}. * * @return notifier based on provided configuration. */ public Notifier initNotifier() { return chooseNotifier().init(); }