/** * Loads a native library and links the methods defined in {@code interfaceClass} * to native methods in the library. * * @deprecated see {@link LibraryLoader} for the preferred interface to loading libraries. * @param <T> the interface type. * @param libraryNames the name of the library to load * @param interfaceClass the interface that describes the native library interface * @param libraryOptions options * @return an instance of {@code interfaceclass} that will call the native methods. */ public static <T> T loadLibrary(Class<T> interfaceClass, Map<LibraryOption, ?> libraryOptions, String... libraryNames) { LibraryLoader<T> loader = FFIProvider.getSystemProvider().createLibraryLoader(interfaceClass); for (String libraryName : libraryNames) { loader.library(libraryName); for (String path : getLibraryPath(libraryName)) { loader.search(path); } } for (Map.Entry<LibraryOption, ?> option : libraryOptions.entrySet()) { loader.option(option.getKey(), option.getValue()); } return loader.failImmediately().load(); }
/** * Loads a native library and links the methods defined in {@code interfaceClass} * to native methods in the library. * * @deprecated see {@link LibraryLoader} for the preferred interface to loading libraries. * @param libraryNames the name of the library to load * @param interfaceClass the interface that describes the native library interface * @param libraryOptions options * @return an instance of {@code interfaceclass} that will call the native methods. */ public static <T> T loadLibrary(Class<T> interfaceClass, Map<LibraryOption, ?> libraryOptions, String... libraryNames) { LibraryLoader<T> loader = FFIProvider.getSystemProvider().createLibraryLoader(interfaceClass); for (String libraryName : libraryNames) { loader.library(libraryName); for (String path : getLibraryPath(libraryName)) { loader.search(path); } } for (Map.Entry<LibraryOption, ?> option : libraryOptions.entrySet()) { loader.option(option.getKey(), option.getValue()); } return loader.failImmediately().load(); }
/** * Loads a native library and links the methods defined in {@code interfaceClass} * to native methods in the library. * * @deprecated see {@link LibraryLoader} for the preferred interface to loading libraries. * @param <T> the interface type. * @param libraryNames the name of the library to load * @param interfaceClass the interface that describes the native library interface * @param libraryOptions options * @return an instance of {@code interfaceclass} that will call the native methods. */ public static <T> T loadLibrary(Class<T> interfaceClass, Map<LibraryOption, ?> libraryOptions, String... libraryNames) { LibraryLoader<T> loader = FFIProvider.getSystemProvider().createLibraryLoader(interfaceClass); for (String libraryName : libraryNames) { loader.library(libraryName); for (String path : getLibraryPath(libraryName)) { loader.search(path); } } for (Map.Entry<LibraryOption, ?> option : libraryOptions.entrySet()) { loader.option(option.getKey(), option.getValue()); } return loader.failImmediately().load(); }
public AbstractFuseFS() { LibraryLoader<LibFuse> loader = LibraryLoader.create(LibFuse.class).failImmediately(); jnr.ffi.Platform p = jnr.ffi.Platform.getNativePlatform(); LibFuse libFuse = null; try { libFuse = LibraryLoader.create(LibFuse.class).failImmediately().load(library); break; } catch (Throwable e) { libFuse = LibraryLoader.create(LibFuse.class).failImmediately().load("fuse"); libFuse = LibraryLoader.create(LibFuse.class).failImmediately().load("libfuse.so.2"); } catch (Throwable e) { libFuse = LibraryLoader.create(LibFuse.class).failImmediately().load("fuse");
public AbstractFuseFS() { LibraryLoader<LibFuse> loader = LibraryLoader.create(LibFuse.class).failImmediately(); jnr.ffi.Platform p = jnr.ffi.Platform.getNativePlatform(); LibFuse libFuse = null; try { libFuse = LibraryLoader.create(LibFuse.class).failImmediately().load(library); break; } catch (Throwable e) { libFuse = LibraryLoader.create(LibFuse.class).failImmediately().load("fuse"); libFuse = LibraryLoader.create(LibFuse.class).failImmediately().load("libfuse.so.2"); } catch (Throwable e) { libFuse = LibraryLoader.create(LibFuse.class).failImmediately().load("fuse");