Class OSMXBean


  • public class OSMXBean
    extends Object
    This class is a wrapper for the implementation of com.sun.management.UnixOperatingSystemMXBean It will decide to use the sun api or its own implementation depending on the runtime (vendor) used.
    • Constructor Detail

      • OSMXBean

        public OSMXBean()
        Constructor. Get the running Operating System instance
    • Method Detail

      • getUnix

        public boolean getUnix()
        Check if the OS is unix. If using the IBM java runtime, this will only work for linux.
        Returns:
        whether this is unix or not.
      • getOpenFileDescriptorCount

        public long getOpenFileDescriptorCount()
        Get the number of opened filed descriptor for the runtime jvm. If sun java, it will use the com.sun.management interfaces. Otherwise, this methods implements it (linux only).
        Returns:
        number of open file descriptors for the jvm
      • getMaxFileDescriptorCount

        public long getMaxFileDescriptorCount()
        Get the number of the maximum file descriptors the system can use. If sun java, it will use the com.sun.management interfaces. Otherwise, this methods implements it (linux only).
        Returns:
        max number of file descriptors the operating system can use.