public static <T> T create(Class<T> type, Throwable cause) { return type.cast(Proxy.newProxyInstance(type.getClassLoader(), new Class[]{type}, new InitializationErrorInvocationHandler(cause))); } }
/*package*/ static Kernel32 load() { try { return (Kernel32) Native.loadLibrary("kernel32", Kernel32.class); } catch (Throwable e) { LOGGER.log(Level.SEVERE, "Failed to load Kernel32", e); return InitializationErrorInvocationHandler.create(Kernel32.class,e); } }
/*package*/ static Kernel32 load() { try { return (Kernel32) Native.loadLibrary("kernel32", Kernel32.class); } catch (Throwable e) { LOGGER.log(Level.SEVERE, "Failed to load Kernel32", e); return InitializationErrorInvocationHandler.create(Kernel32.class,e); } }
public static <T> T create(Class<T> type, Throwable cause) { return type.cast(Proxy.newProxyInstance(type.getClassLoader(), new Class[]{type}, new InitializationErrorInvocationHandler(cause))); } }