Object

za.co.monadic.scopus

LibLoader

Related Doc: package scopus

Permalink

object LibLoader

General loader for dynamic libraries from the resources directory in the jar file. It copies the required library from the jar to the target temporary directory and then optionally loads the file using System.load(). It will clean the directory on JVM shutdown using shutdown hooks. It is clever enough to find the correct directory for the native version of the library (although this is untested). Note that you need to build the JNI native stubs with some care so that dependent libraries can be loaded. In Linux for example, Java must load libjni_opus.so (JNI native code). The actual Opus library is loaded by the dynamic linker from a dependency in the stub. Libjni_opus.so is built to look in the same directory for libopus, so we must copy it to a temporary directory as well, but there is no need to ask the JVM to load it. In Windows, you will need to load it as well.

Libraries are stored in the resources/native/os.name/os.arch directory and copied to the system temporary directory as indicated by the java.io.tmpdir property plus a random one time directory name with the prefix "scopus_". In Linux, the temporary directory would have a name like "/tmp/scopus_418af7c0b63b/".

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. LibLoader
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def apply(libName: String, load: Boolean = true): Unit

    Permalink

    Copy the OS dependent library from the resources dir in a JAR to a temporary location and optionally ask the JVM to load the library.

    Copy the OS dependent library from the resources dir in a JAR to a temporary location and optionally ask the JVM to load the library. The library is deleted on exit from the JVM. If load is false, it just copies the library to the temporary location without loading it.

    libName

    The name of the library to copy and optionally load

    load

    If true, ask the JVM to dynamically load the library using System.load()

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. val destDir: String

    Permalink
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  12. def getOsArch: String

    Permalink
  13. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  14. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  15. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. val path: String

    Permalink
  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  20. val tempPath: String

    Permalink
  21. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  22. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped