39 |
|
|
40 |
package java.lang; |
package java.lang; |
41 |
|
|
42 |
|
import gnu.classpath.VMStackWalker; |
43 |
import gnu.classpath.SystemProperties; |
import gnu.classpath.SystemProperties; |
44 |
|
|
45 |
import java.io.InputStream; |
import java.io.InputStream; |
481 |
* check may be performed, <code>checkLink</code>. This just calls |
* check may be performed, <code>checkLink</code>. This just calls |
482 |
* <code>Runtime.getRuntime().load(filename)</code>. |
* <code>Runtime.getRuntime().load(filename)</code>. |
483 |
* |
* |
484 |
|
* <p> |
485 |
|
* The library is loaded using the class loader associated with the |
486 |
|
* class associated with the invoking method. |
487 |
|
* |
488 |
* @param filename the code file to load |
* @param filename the code file to load |
489 |
* @throws SecurityException if permission is denied |
* @throws SecurityException if permission is denied |
490 |
* @throws UnsatisfiedLinkError if the file cannot be loaded |
* @throws UnsatisfiedLinkError if the file cannot be loaded |
492 |
*/ |
*/ |
493 |
public static void load(String filename) |
public static void load(String filename) |
494 |
{ |
{ |
495 |
Runtime.getRuntime().load(filename); |
Runtime.getRuntime().load(filename, VMStackWalker.getCallingClassLoader()); |
496 |
} |
} |
497 |
|
|
498 |
/** |
/** |
500 |
* check may be performed, <code>checkLink</code>. This just calls |
* check may be performed, <code>checkLink</code>. This just calls |
501 |
* <code>Runtime.getRuntime().load(filename)</code>. |
* <code>Runtime.getRuntime().load(filename)</code>. |
502 |
* |
* |
503 |
|
* <p> |
504 |
|
* The library is loaded using the class loader associated with the |
505 |
|
* class associated with the invoking method. |
506 |
|
* |
507 |
* @param libname the library file to load |
* @param libname the library file to load |
508 |
* @throws SecurityException if permission is denied |
* @throws SecurityException if permission is denied |
509 |
* @throws UnsatisfiedLinkError if the file cannot be loaded |
* @throws UnsatisfiedLinkError if the file cannot be loaded |
511 |
*/ |
*/ |
512 |
public static void loadLibrary(String libname) |
public static void loadLibrary(String libname) |
513 |
{ |
{ |
514 |
Runtime.getRuntime().loadLibrary(libname); |
Runtime.getRuntime().loadLibrary(libname, |
515 |
|
VMStackWalker.getCallingClassLoader()); |
516 |
} |
} |
517 |
|
|
518 |
/** |
/** |