de.flam.flcbyt

## Class NativeLibraryLoader

- java.lang.Object
- - de.flam.flcbyt.NativeLibraryLoader

-     public class NativeLibraryLoader
      extends Object

  Responsible for loading the native DLL required to use the FLAM byte interface. (libflcbytjava.so/dll)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `DEFAULT_ALT_LIBRARY_PATH`
    `static String` | `DEFAULT_LIBRARY_PATH`
    `static String` | `DEFAULT_ZOS31_LIBRARY_PATH`
    `static String` | `DEFAULT_ZOS3164_LIBRARY_PATH`
    `static int` | `JNI_API_LEVEL` The required API level of the JNI DLL of FLAM5

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NativeLibraryLoader()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `getLibraryPath()` Returns the path to the FLAM byte interface JNI DLL
    `static void` | `loadLibrary()` Loads the native JNI-based library (flcbytjava) that backs the functionality of this class.
    `static void` | `setLibraryPath(String libraryPath)` Sets the path to the FLAM byte interface JNI DLL.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_LIBRARY_PATH

          public static final String DEFAULT_LIBRARY_PATH

      See Also:
        Constant Field Values

    - #### DEFAULT_ALT_LIBRARY_PATH

          public static final String DEFAULT_ALT_LIBRARY_PATH

      See Also:
        Constant Field Values

    - #### DEFAULT_ZOS31_LIBRARY_PATH

          public static final String DEFAULT_ZOS31_LIBRARY_PATH

      See Also:
        Constant Field Values

    - #### DEFAULT_ZOS3164_LIBRARY_PATH

          public static final String DEFAULT_ZOS3164_LIBRARY_PATH

      See Also:
        Constant Field Values

    - #### JNI_API_LEVEL

          public static final int JNI_API_LEVEL

      The required API level of the JNI DLL of FLAM5
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### NativeLibraryLoader

          public NativeLibraryLoader()

  - ### Method Detail

    - #### loadLibrary

          public static void loadLibrary()

      Loads the native JNI-based library (flcbytjava) that backs the functionality of this class. If no library path has been set via `setLibraryPath(String)`, the default library "flcbytjava" is loaded. If this fails, an attempt is made to load the library name "libflcbytjava". On z/OS, if this fails, it is attempted to load the library "FLCBYTJV" or "FLCBYTJ3" from your STEPLIB, depending on whether a 31 bit or 64 bit JVM is detected. Running on z/OS in a 64 bit JVM, the 31 bit FLAM byte interface can be used by loading "FLCBYTJ3". The library "FLCBYTJV" can only be used in a 31 bit JVM on z/OS. In both cases, the FLAM load libary must be in the STEPLIB concatenation of your Java invocation to successfully load the library. A JCL example can be found in FLAM.JOBLIB(JZOSFCBI) of your FLAM installation. If the library is already loaded, this method does nothing.
      Throws:
        `UnsatisfiedLinkError` - if the JNI DLL cannot be loaded or if there is an API mismatch between Java code and JNI DLL
      See Also:
        `System.loadLibrary(String)`

    - #### getLibraryPath

          public static String getLibraryPath()

      Returns the path to the FLAM byte interface JNI DLL
      Returns:
        path without file extension

    - #### setLibraryPath

          public static void setLibraryPath(String libraryPath)

      Sets the path to the FLAM byte interface JNI DLL. This must be called before the DLL is loaded (`loadLibrary()`) to have an effect. The library filename must be passed without the file extension.
      Parameters:
        `libraryPath` - ath to the FLAM byte interface JNI DLL without file extension (.dll/.so)
      See Also:
        `System.load(String)`