org.zodiac.sdk.simplenetty.exception.ExceptionHelper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zodiac-sdk-nio Show documentation
Show all versions of zodiac-sdk-nio Show documentation
Zodiac SDK NIO2(New Non-Blocking IO)
package org.zodiac.sdk.simplenetty.exception;
//import sun.misc.Unsafe;
import org.zodiac.sdk.nio.common.Unsafe;
public class ExceptionHelper {
// static final Unsafe UNSAFE;
static {
try {
// Class> unsafeClass = Class.forName("sun.misc.Unsafe");
// Field field = unsafeClass.getDeclaredField("theUnsafe");
// field.setAccessible(true);
// UNSAFE = (Unsafe)field.get(null);
} catch (Exception e) {
throw new RuntimeException("UNSAFE get fail");
}
}
public static void throwException(E e) {
Unsafe.throwException(e);
}
}