org.kitesdk.morphline.base.Notifications.getLifecycleEvents()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(156)

本文整理了Java中org.kitesdk.morphline.base.Notifications.getLifecycleEvents()方法的一些代码示例,展示了Notifications.getLifecycleEvents()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Notifications.getLifecycleEvents()方法的具体详情如下:
包路径:org.kitesdk.morphline.base.Notifications
类名称:Notifications
方法名:getLifecycleEvents

Notifications.getLifecycleEvents介绍

[英]Get all lifecycle events from the given record.
[中]

代码示例

代码示例来源:origin: kite-sdk/kite

/**
 * 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);
}

代码示例来源:origin: org.kitesdk/kite-morphlines-core

/**
 * 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);
}

代码示例来源:origin: cloudera-labs/envelope

@Override
public void notify(Record notification) {
 for (Object event : Notifications.getLifecycleEvents(notification)) {
  if (event == Notifications.LifecycleEvent.START_SESSION) {
   reset();
  }
 }
}

代码示例来源:origin: org.kitesdk/kite-morphlines-maxmind

@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);
}

代码示例来源:origin: kite-sdk/kite

@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);
}

代码示例来源:origin: kite-sdk/kite

@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);
}

代码示例来源:origin: org.kitesdk/kite-morphlines-metrics-servlets

@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);
}

代码示例来源:origin: com.stratio.morphlines/geoip

@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);
  }
}

代码示例来源:origin: kite-sdk/kite

@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);
}

代码示例来源:origin: org.kitesdk/kite-morphlines-core

@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);
}

代码示例来源:origin: org.kitesdk/kite-morphlines-core

@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);
}

代码示例来源:origin: org.kitesdk/kite-morphlines-core

@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);
}

代码示例来源:origin: kite-sdk/kite

@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);
}

代码示例来源:origin: kite-sdk/kite

@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);
}

代码示例来源:origin: org.apache.solr/solr-morphlines-core

@Override
protected void doNotify(Record notification) {
 for (Object event : Notifications.getLifecycleEvents(notification)) {
  if (event == Notifications.LifecycleEvent.BEGIN_TRANSACTION) {
   try {

代码示例来源:origin: org.kitesdk/kite-morphlines-solr-core

@Override
protected void doNotify(Record notification) {
 for (Object event : Notifications.getLifecycleEvents(notification)) {
  if (event == Notifications.LifecycleEvent.BEGIN_TRANSACTION) {
   try {

代码示例来源:origin: kite-sdk/kite

@Override
protected void doNotify(Record notification) {
 for (Object event : Notifications.getLifecycleEvents(notification)) {
  if (event == Notifications.LifecycleEvent.BEGIN_TRANSACTION) {
   try {

相关文章