Package org.jboss.netty.util.internal
Class DetectionUtil
- java.lang.Object
-
- org.jboss.netty.util.internal.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 thesun.misc.Unsafe
object.
You can disable the use ofsun.misc.Unsafe
if you specify the System property org.jboss.netty.tryUnsafe with value offalse
. Default istrue
.
-
-
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()
Returntrue
if the JVM is running on Windowsstatic int
javaVersion()
private static int
javaVersion0()
-
-
-
Method Detail
-
isWindows
public static boolean isWindows()
Returntrue
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()
-
-