Package org.jboss.netty.util.internal
Class DetectionUtil
java.lang.Object
org.jboss.netty.util.internal.DetectionUtil
Utility that detects various properties specific to the current runtime
environment, such as Java version and the availability of the
You can disable the use of
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
FieldsModifier and TypeFieldDescriptionprivate static final booleanprivate static final booleanprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanprivate static booleanhasUnsafe(ClassLoader loader) private static booleanhasUnsafeField(Class<?> unsafeClass) static booleanReturntrueif the JVM is running on Windowsstatic intprivate static int
-
Field Details
-
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 Details
-
DetectionUtil
private DetectionUtil()
-
-
Method Details
-
isWindows
public static boolean isWindows()Returntrueif the JVM is running on Windows -
hasUnsafe
public static boolean hasUnsafe() -
javaVersion
public static int javaVersion() -
hasUnsafe
-
hasUnsafeField
- Throws:
PrivilegedActionException
-
javaVersion0
private static int javaVersion0()
-