All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.jmx.JBossMBeanServerLookup Maven / Gradle / Ivy

There is a newer version: 15.1.0.Dev04
Show newest version
package org.infinispan.jmx;

import java.util.Properties;

import javax.management.MBeanServer;

import org.infinispan.commons.CacheException;
import org.infinispan.commons.util.Util;

/**
 * MBeanServer lookup implementation to locate the JBoss MBeanServer.
 *
 * @author Galder Zamarreño
 * @since 4.2
 */
public class JBossMBeanServerLookup implements MBeanServerLookup {

   @Override
   public MBeanServer getMBeanServer(Properties properties) {
      Class mbsLocator = Util.loadClass("org.jboss.mx.util.MBeanServerLocator", null);
      try {
         return (MBeanServer) mbsLocator.getMethod("locateJBoss").invoke(null);
      } catch (Exception e) {
         throw new CacheException("Unable to locate JBoss MBean server", e);
      }
   }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy