private Long runUnixMXBeanMethod(String mBeanMethodName) {
    Object unixos;
    Class<?> classRef;
    Method mBeanMethod;

    try {
      classRef = Class.forName("com.sun.management.UnixOperatingSystemMXBean");
      if (classRef.isInstance(osMbean)) {
        mBeanMethod = classRef.getMethod(mBeanMethodName);
        unixos = classRef.cast(osMbean);
        return (Long) mBeanMethod.invoke(unixos);
      }
    } catch (Exception e) {
      LOG.warn(
        "Not able to load class or method for" + " com.sun.management.UnixOperatingSystemMXBean.",
        e);
    }
    return null;
  }
Load the implementation of UnixOperatingSystemMXBean for Oracle jvm and runs the desired
method.
@param mBeanMethodName : method to run from the interface UnixOperatingSystemMXBean
@return the method result
hbase-common/src/main/java/org/apache/hadoop/hbase/util/JVM.java