public final class JNI extends Object
By default, it attempts to load the library 'clearsilver-jni' from the
path specified in the 'java.library.path' system property. However, this
can be overriden by calling setLibraryName(String)
and
setLibrarySearchPaths(String[])
.
If this fails, the JVM exits with a code of 1. However, this strategy
can be changed using setFailureCallback(Runnable)
.
Modifier and Type | Field and Description |
---|---|
static Runnable |
EXIT_JVM
Failure callback strategy that writes a message to sysout, then calls
System.exit(1).
|
static Runnable |
THROW_ERROR
Failure callback strategy that throws an UnsatisfiedLinkError, which
should be caught be client code.
|
Constructor and Description |
---|
JNI() |
Modifier and Type | Method and Description |
---|---|
static void |
loadLibrary()
Attempts to load the ClearSilver JNI library.
|
static void |
setFailureCallback(Runnable failureCallback)
Sets a callback for what should happen if the JNI library cannot
be loaded.
|
static void |
setLibraryName(String libraryName)
Set name of JNI library to load.
|
static void |
setLibrarySearchPaths(String... paths)
Sets locations where JNI library is searched.
|
public static Runnable EXIT_JVM
public static Runnable THROW_ERROR
public static void loadLibrary()
setFailureCallback(Runnable)
public static void setFailureCallback(Runnable failureCallback)
EXIT_JVM
.EXIT_JVM
,
THROW_ERROR
public static void setLibraryName(String libraryName)
public static void setLibrarySearchPaths(String... paths)
Copyright © 2010-2014 Google. All Rights Reserved.