protected void tryLoad(String libFile) throws UnsupportedOperationException { hsl = (HunspellLibrary)Native.loadLibrary(libFile, HunspellLibrary.class); }
/*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); } }
Posix posix = (Posix) Native.loadLibrary("c", Posix.class); int returnCode = posix.symlink(filePath, symLinkPath); if (returnCode < 0)
hsl = (HunspellLibrary)Native.loadLibrary(libFile, HunspellLibrary.class); } catch (UnsatisfiedLinkError urgh) { hsl = (HunspellLibrary)Native.loadLibrary(lib.getAbsolutePath(), HunspellLibrary.class);
/** * Provided for improved compatibility between JNA 4.X and 5.X * * @see Native#load(java.lang.Class, java.util.Map) */ @Deprecated public static <T> T loadLibrary(Class<T> interfaceClass, Map<String, ?> options) { return loadLibrary(null, interfaceClass, options); }
/** * Provided for improved compatibility between JNA 4.X and 5.X * * @see Native#load(java.lang.Class) */ @Deprecated public static <T> T loadLibrary(Class<T> interfaceClass) { return loadLibrary(null, interfaceClass); }
/** * Provided for improved compatibility between JNA 4.X and 5.X * * @see Native#load(java.lang.String, java.lang.Class) */ @Deprecated public static <T> T loadLibrary(String name, Class<T> interfaceClass) { return loadLibrary(name, interfaceClass, Collections.<String, Object>emptyMap()); }
/** * Loads Tesseract library via JNA. * * @return TessAPI instance being loaded using * <code>Native.loadLibrary()</code>. */ public static TessAPI getTessAPIInstance() { return (TessAPI) Native.loadLibrary(getTesseractLibName(), TessAPI.class); }
/** Load a library interface from the given shared library, providing * the explicit interface class. */ public static Object loadLibrary(String name, Class interfaceClass) { return loadLibrary(name, interfaceClass, Collections.EMPTY_MAP); }
public static LibCItf get(){ if( instance!=null )return instance; instance = (LibCItf)Native.loadLibrary("c",LibCItf.class); return instance; } }
public static XvfbScreenshotInterface getXvfbInterface() { if(xvfbInterface == null) { xvfbInterface = (XvfbScreenshotInterface) Native.loadLibrary("xvfb_interface", XvfbScreenshotInterface.class); } return xvfbInterface; }
@Override public <T> T loadLibrary(String libraryName, Class<T> libraryClass) { return libraryClass.cast(Native.loadLibrary(libraryName, libraryClass)); }
public static HyphenLibrary getLibrary() { if (instance == null) { try { String name = (libraryPath != null) ? libraryPath.getCanonicalPath() : "hyphen"; instance = (HyphenLibrary)Native.loadLibrary(name, HyphenLibrary.class); } catch (IOException e) { throw new RuntimeException("Could not load libhyphen", e); }} return instance; }
/*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); } }
private synchronized static void loadLibrary (String path) { if (_lib != null) return; int os = Indigo.getOs(); if (os == Indigo.OS_LINUX || os == Indigo.OS_SOLARIS) _lib = (IndigoRendererLib)Native.loadLibrary(getPathToBinary(path, "libindigo-renderer.so"), IndigoRendererLib.class); else if (os == Indigo.OS_MACOS) _lib = (IndigoRendererLib)Native.loadLibrary(getPathToBinary(path, "libindigo-renderer.dylib"), IndigoRendererLib.class); else // os == OS_WINDOWS _lib = (IndigoRendererLib)Native.loadLibrary(getPathToBinary(path, "indigo-renderer.dll"), IndigoRendererLib.class); }
public static final Object getLibrary(String name, String path, final Class<?> libraryClass) { Object original = com.sun.jna.Native.loadLibrary(path, libraryClass, MangledFunctionMapper.DEFAULT_OPTIONS); return shouldTraceCalls(name) ? LibraryExtractor.getTracingLibrary(original, libraryClass) : original; }
public static final Object getLibrary(String name, String path, final Class<?> libraryClass) { Object original = com.sun.jna.Native.loadLibrary(path, libraryClass, MangledFunctionMapper.DEFAULT_OPTIONS); return shouldTraceCalls(name) ? LibraryExtractor.getTracingLibrary(original, libraryClass) : original; }
public static void setConsoleTitle(String title) { if(!Platform.isWindows()) { return; } Kernel32 lib = (Kernel32) Native.loadLibrary("kernel32", Kernel32.class); lib.SetConsoleTitleA(title); } }
protected static synchronized void loadLibrary(UnixSyslogConfig config) throws SyslogRuntimeException { if (!OSDetectUtility.isUnix()) { throw new SyslogRuntimeException("UnixSyslog not supported on non-Unix platforms"); } if (libraryInstance == null) { libraryInstance = (CLibrary) Native.loadLibrary(config.getLibrary(), CLibrary.class); } }
protected synchronized void loadLibrary() { if (!OSDetectUtility.isUnix()) { throw new SyslogRuntimeException("UnixSyslog not supported on non-Unix platforms"); } if (!this.libraryLoaded) { this.libraryInstance = (CLibrary) Native.loadLibrary(this.unixSocketSyslogConfig.getLibrary(), CLibrary.class); this.libraryLoaded = true; } }