Пример #1
0
  @Override
  public void cacheStopping(ComponentRegistry cr, String cacheName) {
    // TODO move this to cacheStopped event (won't work right now as the ComponentRegistry is half
    // empty at that point: ISPN-1006)
    Object searchFactoryIntegrator = cr.getComponent(SearchFactoryIntegrator.class);
    if (searchFactoryIntegrator != null && searchFactoryIntegrator != REMOVED_REGISTRY_COMPONENT) {
      searchFactoriesToShutdown.put(cacheName, (SearchFactoryIntegrator) searchFactoryIntegrator);
      // free some memory by de-registering the SearchFactory
      cr.registerComponent(REMOVED_REGISTRY_COMPONENT, SearchFactoryIntegrator.class);
    }

    // Unregister MBeans
    if (mbeanServer != null) {
      String queryMBeanFilter = jmxDomain + ":" + getQueryGroupName(cacheName) + ",*";
      JmxUtil.unregisterMBeans(queryMBeanFilter, mbeanServer);
    }
  }