@Override
 public void contextDestroyed(ServletContextEvent sce) {
   if (configurationManager != null) {
     configurationManager.unsubscribeFrom("container.cfg.xml", configListener);
     configurationManager.unsubscribeFrom("system-model.cfg.xml", systemModelListener);
   }
 }
 @Override
 public void contextInitialized(ServletContextEvent sce) {
   configurationManager.subscribeTo(
       "container.cfg.xml", configListener, ContainerConfiguration.class);
   configurationManager.subscribeTo(
       "system-model.cfg.xml", systemModelListener, SystemModel.class);
   register();
 }
Пример #3
0
 @Override
 public void contextInitialized(ServletContextEvent servletContextEvent) {
   URL xsdURL = getClass().getResource("/META-INF/schema/container/container-configuration.xsd");
   configurationManager.subscribeTo(
       "container.cfg.xml", xsdURL, configurationListener, ContainerConfiguration.class);
   register();
 }
 @Override
 public void contextDestroyed(ServletContextEvent sce) {
   configurationManager.unsubscribeFrom("system-model.cfg.xml", systemModelConfigurationListener);
   Set<String> instances = controllerService.getManagedInstances();
   controllerService.updateManagedInstances(null, instances);
   curNodes.clear();
 }
  private void addListener(String wadl) {
    if (wadl == null) {
      return;
    }

    LOG.info("Watching WADL: " + wadl);
    manager.subscribeTo(wadl, wadlListener, new GenericResourceConfigurationParser());
  }
Пример #6
0
  @Override
  public void contextInitialized(ServletContextEvent sce) {

    URL xsdURL = getClass().getResource("/META-INF/schema/metrics/metrics.xsd");
    configurationService.subscribeTo(
        "metrics.cfg.xml", xsdURL, metricsCfgListener, MetricsConfiguration.class);

    register();
  }
Пример #7
0
  @Override
  public void init(FilterConfig filterConfig) throws ServletException {
    final ServletContext servletContext = filterConfig.getServletContext();
    final ServicePorts ports = ServletContextHelper.getInstance(servletContext).getServerPorts();

    config = new FilterConfigHelper(filterConfig).getFilterConfig(DEFAULT_CONFIG);
    LOG.info("Initializing filter using config " + config);
    handlerFactory = new VersioningHandlerFactory(ports);
    configurationManager =
        ServletContextHelper.getInstance(filterConfig.getServletContext())
            .getPowerApiContext()
            .configurationService();

    configurationManager.subscribeTo("system-model.cfg.xml", handlerFactory, SystemModel.class);
    URL xsdURL = getClass().getResource("/META-INF/schema/config/versioning-configuration.xsd");

    configurationManager.subscribeTo(
        config, xsdURL, handlerFactory, ServiceVersionMappingList.class);
  }
 @Override
 public void contextInitialized(ServletContextEvent sce) {
   this.configDir =
       sce.getServletContext()
           .getInitParameter(InitParameter.POWER_API_CONFIG_DIR.getParameterName());
   this.isInsecure =
       Boolean.parseBoolean(
           sce.getServletContext().getInitParameter(InitParameter.INSECURE.getParameterName()));
   controllerService.setConfigDirectory(configDir);
   URL xsdURL = getClass().getResource("/META-INF/schema/system-model/system-model.xsd");
   URL containerXsdURL =
       getClass().getResource("/META-INF/schema/container/container-configuration.xsd");
   configurationManager.subscribeTo(
       "container.cfg.xml",
       containerXsdURL,
       containerConfigurationListener,
       ContainerConfiguration.class);
   configurationManager.subscribeTo(
       "system-model.cfg.xml", xsdURL, systemModelConfigurationListener, SystemModel.class);
   register();
 }
  private void unsubscribeAll() {
    synchronized (lock) {
      initialized = false;
      if (validators == null) {
        return;
      }

      for (ValidatorInfo info : validators) {
        if (StringUtilities.isNotBlank(info.getUri())) {
          manager.unsubscribeFrom(info.getUri(), wadlListener);
        }
      }
    }
  }
Пример #10
0
 @Override
 public void contextDestroyed(ServletContextEvent servletContextEvent) {
   if (configurationManager != null) {
     configurationManager.unsubscribeFrom("container.cfg.xml", configurationListener);
   }
 }
Пример #11
0
  @Override
  public void contextDestroyed(ServletContextEvent sce) {

    metricsService.destroy();
    configurationService.unsubscribeFrom("metrics.cfg.xml", metricsCfgListener);
  }
Пример #12
0
 @Override
 public void destroy() {
   configurationManager.unsubscribeFrom("system-model.cfg.xml", handlerFactory);
   configurationManager.unsubscribeFrom(config, handlerFactory);
 }