private void unregisterQueryMBeans ( ComponentRegistry cr , String cacheName ) { if ( mbeanServer != null ) { try { InfinispanQueryStatisticsInfo stats = cr . getComponent ( InfinispanQueryStatisticsInfo . class ) ; if ( stats != null ) { GlobalJmxStatisticsConfiguration jmxConfig = cr . getGlobalComponentRegistry ( ) . getGlobalConfiguration ( ) . globalJmxStatistics ( ) ; String queryGroupName = getQueryGroupName ( jmxConfig . cacheManagerName ( ) , cacheName ) ; String queryMBeanFilter = stats . getObjectName ( ) . getDomain ( ) + ":" + queryGroupName + ",*" ; JmxUtil . unregisterMBeans ( queryMBeanFilter , mbeanServer ) ; } } catch ( Exception e ) { throw new CacheException ( "Unable to unregister query MBeans" , e ) ; } } }
Unregister query related MBeans for a cache primarily the statistics but also all other MBeans from the same related group .