All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jnr.ffi.InvalidProvider Maven / Gradle / Ivy

There is a newer version: 2.2.16
Show newest version
package jnr.ffi;

import java.util.Map;

final class InvalidProvider extends FFIProvider {
    private final String message;
    private final Throwable cause;
    private final 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  T loadLibrary(String libraryName, Class interfaceClass, Map libraryOptions) {
        throw newLoadError();
    }

    @Override
    public  T loadLibrary(Class interfaceClass, Map libraryOptions, String... libraryNames) {
        throw newLoadError();
    }

    private UnsatisfiedLinkError newLoadError() {
        UnsatisfiedLinkError error = new UnsatisfiedLinkError(message);
        error.initCause(cause);
        throw error;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy