class ContentSelectorUpgradeManager extends StateGuardLifecycleSupport {

  @Override
  protected void doStart() throws Exception {
    selectorManager.browseJexl().forEach(config -> {
      String expression = config.getAttributes().get("expression");
      String name = config.getName();

      log.debug("Attempting to upgrade JEXL content selector {} to CSEL, expression={}", name, expression);

      try {
        selectorFactory.validateSelector(CselSelector.TYPE, expression);
        config.setType(CselSelector.TYPE);
        selectorManager.update(config);
      }
      catch (Exception e) {
        log.warn("Could not upgrade JEXL content selector {} to CSEL, expression={}",
            name, expression, log.isDebugEnabled() ? e : null);
      }
    });
  }

  @Inject public  ContentSelectorUpgradeManager(final SelectorFactory selectorFactory, final SelectorManager selectorManager);

}