jnr.ffi.provider.InvalidProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jnr-ffi Show documentation
Show all versions of jnr-ffi Show documentation
A library for invoking native functions from java
package jnr.ffi.provider;
import jnr.ffi.*;
import jnr.ffi.Runtime;
import java.util.Collection;
import java.util.Map;
final class InvalidProvider extends FFIProvider {
private final String message;
private final Throwable cause;
private final jnr.ffi.Runtime runtime;
InvalidProvider(String message, Throwable cause) {
this.message = message;
this.cause = cause;
this.runtime = new InvalidRuntime(message, cause);
}
@Override
public Runtime getRuntime() {
return runtime;
}
@Override
public LibraryLoader createLibraryLoader(Class interfaceClass) {
return new LibraryLoader(interfaceClass) {
@Override
protected T loadLibrary(Class interfaceClass, Collection libraryNames, Collection searchPaths, Map options) {
UnsatisfiedLinkError error = new UnsatisfiedLinkError(message);
error.initCause(cause);
throw error;
}
};
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy