Class DetectionUtil


  • public final class DetectionUtil
    extends java.lang.Object
    Utility that detects various properties specific to the current runtime environment, such as Java version and the availability of the sun.misc.Unsafe object.
    You can disable the use of sun.misc.Unsafe if you specify the System property org.jboss.netty.tryUnsafe with value of false. Default is true.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static boolean HAS_UNSAFE  
      private static boolean IS_WINDOWS  
      private static int JAVA_VERSION  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private DetectionUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean hasUnsafe()  
      private static boolean hasUnsafe​(java.lang.ClassLoader loader)  
      private static boolean hasUnsafeField​(java.lang.Class<?> unsafeClass)  
      static boolean isWindows()
      Return true if the JVM is running on Windows
      static int javaVersion()  
      private static int javaVersion0()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • JAVA_VERSION

        private static final int JAVA_VERSION
      • HAS_UNSAFE

        private static final boolean HAS_UNSAFE
      • IS_WINDOWS

        private static final boolean IS_WINDOWS
    • Constructor Detail

      • DetectionUtil

        private DetectionUtil()
    • Method Detail

      • isWindows

        public static boolean isWindows()
        Return true if the JVM is running on Windows
      • hasUnsafe

        public static boolean hasUnsafe()
      • javaVersion

        public static int javaVersion()
      • hasUnsafe

        private static boolean hasUnsafe​(java.lang.ClassLoader loader)
      • hasUnsafeField

        private static boolean hasUnsafeField​(java.lang.Class<?> unsafeClass)
                                       throws java.security.PrivilegedActionException
        Throws:
        java.security.PrivilegedActionException
      • javaVersion0

        private static int javaVersion0()