You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by is...@apache.org on 2018/10/21 21:31:05 UTC
svn commit: r1844523 -
/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/jni/Library.java
Author: isapir
Date: Sun Oct 21 21:31:04 2018
New Revision: 1844523
URL: http://svn.apache.org/viewvc?rev=1844523&view=rev
Log:
Added util methods load and loadLibrary per BZ 62830
Modified:
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/jni/Library.java
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/jni/Library.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/jni/Library.java?rev=1844523&r1=1844522&r2=1844523&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/jni/Library.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/jni/Library.java Sun Oct 21 21:31:04 2018
@@ -226,4 +226,41 @@ public final class Library {
}
return initialize();
}
+
+ /**
+ * Calls System.load(filename). System.load() associates the
+ * loaded library with the class loader of the class that called
+ * the System method. A native library may not be loaded by more
+ * than one class loader, so calling the System method from a class that
+ * was loaded by a Webapp class loader will make it impossible for
+ * other Webapps to load it.
+ *
+ * Using this method will load the native library via a shared class
+ * loader (typically the Common class loader, but may vary in some
+ * configurations), so that it can be loaded by multiple Webapps.
+ *
+ * @param filename - absolute path of the native library
+ */
+ public static void load(String filename){
+ System.load(filename);
+ }
+
+ /**
+ * Calls System.loadLibrary(libname). System.loadLibrary() associates the
+ * loaded library with the class loader of the class that called
+ * the System method. A native library may not be loaded by more
+ * than one class loader, so calling the System method from a class that
+ * was loaded by a Webapp class loader will make it impossible for
+ * other Webapps to load it.
+ *
+ * Using this method will load the native library via a shared class
+ * loader (typically the Common class loader, but may vary in some
+ * configurations), so that it can be loaded by multiple Webapps.
+ *
+ * @param libname - the name of the native library
+ */
+ public static void loadLibrary(String libname){
+ System.loadLibrary(libname);
+ }
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org