/** * Determine whether or not the given notification contains the given lifecycle event. * @param notification A {@link Record} that represents a notification. * @param event A {@link LifecycleEvent} enumeration that is to be searched for in the given notification. */ public static boolean containsLifecycleEvent(Record notification, LifecycleEvent event) { return getLifecycleEvents(notification).contains(event); }
/** * Determine whether or not the given notification contains the given lifecycle event. * @param notification A {@link Record} that represents a notification. * @param event A {@link LifecycleEvent} enumeration that is to be searched for in the given notification. */ public static boolean containsLifecycleEvent(Record notification, LifecycleEvent event) { return getLifecycleEvents(notification).contains(event); }
@Override public void notify(Record notification) { for (Object event : Notifications.getLifecycleEvents(notification)) { if (event == Notifications.LifecycleEvent.START_SESSION) { reset(); } } }
@Override protected void doNotify(Record notification) { for (Object event : Notifications.getLifecycleEvents(notification)) { if (event == Notifications.LifecycleEvent.SHUTDOWN) { try { databaseReader.close(); } catch (IOException e) { LOG.warn("Cannot close Maxmind database: " + databaseFile, e); } } } super.doNotify(notification); }
@Override protected void doNotify(Record notification) { for (Object event : Notifications.getLifecycleEvents(notification)) { if (event == Notifications.LifecycleEvent.SHUTDOWN) { try { databaseReader.close(); } catch (IOException e) { LOG.warn("Cannot close Maxmind database: " + databaseFile, e); } } } super.doNotify(notification); }
@Override protected void doNotify(Record notification) { for (Object event : Notifications.getLifecycleEvents(notification)) { if (event == Notifications.LifecycleEvent.SHUTDOWN) { synchronized (SERVERS) { Server server = SERVERS.remove(port); if (server != null) { try { server.stop(); server.join(); } catch (Exception e) { throw new MorphlineRuntimeException(e); } } } } } super.doNotify(notification); }
@Override protected void doNotify(Record notification) { for (Object event : Notifications.getLifecycleEvents(notification)) { if (event == Notifications.LifecycleEvent.SHUTDOWN) { synchronized (SERVERS) { Server server = SERVERS.remove(port); if (server != null) { try { server.stop(); server.join(); } catch (Exception e) { throw new MorphlineRuntimeException(e); } } } } } super.doNotify(notification); }
@Override protected void doNotify(Record notification) { for (Object event : Notifications.getLifecycleEvents(notification)) { if (event == Notifications.LifecycleEvent.SHUTDOWN) { try { databaseReader.close(); } catch (IOException e) { LOG.warn("Cannot close Maxmind database: " + databaseFile, e); } } } super.doNotify(notification); } }
@Override protected void doNotify(Record notification) { for (Object event : Notifications.getLifecycleEvents(notification)) { if (event == Notifications.LifecycleEvent.SHUTDOWN) { synchronized (REGISTRIES) { Map<String, JmxReporter> reporters = REGISTRIES.get(getContext().getMetricRegistry()); if (reporters != null) { JmxReporter reporter = reporters.remove(domain); if (reporter != null) { reporter.stop(); } } } } } super.doNotify(notification); }
@Override protected void doNotify(Record notification) { for (Object event : Notifications.getLifecycleEvents(notification)) { if (event == Notifications.LifecycleEvent.SHUTDOWN) { synchronized (REGISTRIES) { Map<String, Slf4jReporter> reporters = REGISTRIES.get(getContext().getMetricRegistry()); if (reporters != null) { Slf4jReporter reporter = reporters.remove(logger); if (reporter != null) { reporter.stop(); } } } } } super.doNotify(notification); }
@Override protected void doNotify(Record notification) { for (Object event : Notifications.getLifecycleEvents(notification)) { if (event == Notifications.LifecycleEvent.SHUTDOWN) { synchronized (REGISTRIES) { Map<File, CsvReporter> reporters = REGISTRIES.get(getContext().getMetricRegistry()); if (reporters != null) { CsvReporter reporter = reporters.remove(outputDir); if (reporter != null) { reporter.stop(); } } } } } super.doNotify(notification); }
@Override protected void doNotify(Record notification) { for (Object event : Notifications.getLifecycleEvents(notification)) { if (event == Notifications.LifecycleEvent.SHUTDOWN) { synchronized (REGISTRIES) { Map<String, JmxReporter> reporters = REGISTRIES.get(getContext().getMetricRegistry()); if (reporters != null) { JmxReporter reporter = reporters.remove(domain); if (reporter != null) { reporter.stop(); } } } } } super.doNotify(notification); }
@Override protected void doNotify(Record notification) { for (Object event : Notifications.getLifecycleEvents(notification)) { if (event == Notifications.LifecycleEvent.SHUTDOWN) { synchronized (REGISTRIES) { Map<File, CsvReporter> reporters = REGISTRIES.get(getContext().getMetricRegistry()); if (reporters != null) { CsvReporter reporter = reporters.remove(outputDir); if (reporter != null) { reporter.stop(); } } } } } super.doNotify(notification); }
@Override protected void doNotify(Record notification) { for (Object event : Notifications.getLifecycleEvents(notification)) { if (event == Notifications.LifecycleEvent.SHUTDOWN) { synchronized (REGISTRIES) { Map<String, Slf4jReporter> reporters = REGISTRIES.get(getContext().getMetricRegistry()); if (reporters != null) { Slf4jReporter reporter = reporters.remove(logger); if (reporter != null) { reporter.stop(); } } } } } super.doNotify(notification); }
@Override protected void doNotify(Record notification) { for (Object event : Notifications.getLifecycleEvents(notification)) { if (event == Notifications.LifecycleEvent.BEGIN_TRANSACTION) { try {
@Override protected void doNotify(Record notification) { for (Object event : Notifications.getLifecycleEvents(notification)) { if (event == Notifications.LifecycleEvent.BEGIN_TRANSACTION) { try {
@Override protected void doNotify(Record notification) { for (Object event : Notifications.getLifecycleEvents(notification)) { if (event == Notifications.LifecycleEvent.BEGIN_TRANSACTION) { try {