Package org.jboss.netty.util.internal
Class DetectionUtil
- java.lang.Object
-
- org.jboss.netty.util.internal.DetectionUtil
-
public final class DetectionUtil extends java.lang.ObjectUtility that detects various properties specific to the current runtime environment, such as Java version and the availability of thesun.misc.Unsafeobject.
You can disable the use ofsun.misc.Unsafeif you specify the System property org.jboss.netty.tryUnsafe with value offalse. Default istrue.
-
-
Field Summary
Fields Modifier and Type Field Description private static booleanHAS_UNSAFEprivate static booleanIS_WINDOWSprivate static intJAVA_VERSION
-
Constructor Summary
Constructors Modifier Constructor Description privateDetectionUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanhasUnsafe()private static booleanhasUnsafe(java.lang.ClassLoader loader)private static booleanhasUnsafeField(java.lang.Class<?> unsafeClass)static booleanisWindows()Returntrueif the JVM is running on Windowsstatic intjavaVersion()private static intjavaVersion0()
-
-
-
Method Detail
-
isWindows
public static boolean isWindows()
Returntrueif 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()
-
-