Ejemplo n.º 1
0
  static {
    try {
      // register memory manager mbean
      MBeanServer mbeanServer = java.lang.management.ManagementFactory.getPlatformMBeanServer();
      ObjectName mbeanName =
          new ObjectName(JMXUtil.JMX_DOMAIN, "name", "SortCollectorImpl-MemoryManager-Int");
      StandardMBean mbean =
          new StandardMBean(intarraymgr.getAdminMBean(), MemoryManagerAdminMBean.class);
      mbeanServer.registerMBean(mbean, mbeanName);

      mbeanName =
          new ObjectName(JMXUtil.JMX_DOMAIN, "name", "SortCollectorImpl-MemoryManager-Float");
      mbean = new StandardMBean(floatarraymgr.getAdminMBean(), MemoryManagerAdminMBean.class);
      mbeanServer.registerMBean(mbean, mbeanName);
    } catch (Exception e) {
      logger.error(e.getMessage(), e);
    }
  }
Ejemplo n.º 2
0
 public void close() {
   if (!_closed) {
     _closed = true;
     if (contextList != null) {
       for (CollectorContext context : contextList) {
         context.clearRuntimeFacetData();
       }
     }
     if (docidarraylist != null) {
       while (!docidarraylist.isEmpty()) {
         intarraymgr.release(docidarraylist.poll());
       }
     }
     if (scorearraylist != null) {
       while (!scorearraylist.isEmpty()) {
         floatarraymgr.release(scorearraylist.poll());
       }
     }
   }
 }