public final class MBeanUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
JMX_HOST_PREFIX |
static String |
JMX_OBJECT_NAME |
static String |
JMX_TARGET_PREFIX |
static String |
JMX_URL_SEPARATOR |
static String |
JMX_URL_SUFFIX |
static int |
RMI_REGISTRY_PORT |
Modifier and Type | Method and Description |
---|---|
static String |
constructJmxUrl(String targetHost,
int rmiRegistryPort) |
static JMXServiceURL |
getJMXUrl(String targetHost) |
static <T> T |
getMBean(String jmxName,
Class<T> klass) |
static Object |
getMBeanAttribute(String objName,
String attribute) |
static <T,R> R |
invokeRemoteMBeanOperation(String remoteURL,
String jmxName,
Class<T> klass,
Function<T,R> function) |
static MBeanServer |
registerServerMBean(Object mxBeanImplementor,
String objNameStr) |
static org.apache.commons.lang3.tuple.Pair<JMXConnectorServer,Registry> |
startRMIConnectorServer(MBeanServer mbeanServer,
String selfAddress) |
static void |
stopRMIConnectorServer(org.apache.commons.lang3.tuple.Pair<JMXConnectorServer,Registry> jmxConnector) |
static void |
unregisterServerMBean(Object mxBeanImplementor,
String objNameStr) |
public static final String JMX_OBJECT_NAME
public static final String JMX_HOST_PREFIX
public static final String JMX_TARGET_PREFIX
public static final String JMX_URL_SUFFIX
public static final String JMX_URL_SEPARATOR
public static final int RMI_REGISTRY_PORT
public static JMXServiceURL getJMXUrl(String targetHost) throws MalformedURLException
MalformedURLException
public static org.apache.commons.lang3.tuple.Pair<JMXConnectorServer,Registry> startRMIConnectorServer(MBeanServer mbeanServer, String selfAddress) throws IOException
IOException
public static void stopRMIConnectorServer(org.apache.commons.lang3.tuple.Pair<JMXConnectorServer,Registry> jmxConnector) throws IOException
IOException
public static MBeanServer registerServerMBean(Object mxBeanImplementor, String objNameStr) throws JMException
JMException
public static void unregisterServerMBean(Object mxBeanImplementor, String objNameStr) throws MalformedObjectNameException, InstanceNotFoundException, MBeanRegistrationException
@Nullable public static Object getMBeanAttribute(String objName, String attribute) throws JMException
JMException
public static <T> T getMBean(String jmxName, Class<T> klass) throws MalformedObjectNameException
MalformedObjectNameException
public static <T,R> R invokeRemoteMBeanOperation(String remoteURL, String jmxName, Class<T> klass, Function<T,R> function) throws MalformedObjectNameException, IOException
Copyright © 2019 OpenDaylight. All rights reserved.