src/share/classes/sun/awt/image/NativeLibLoader.java

Print this page




  36      * package (sun.awt.image) have a native method, initIDs(),
  37      * which initializes
  38      * the JNI field and method ids used in the native portion of
  39      * their implementation.
  40      *
  41      * Since the use and storage of these ids is done by the
  42      * implementation libraries, the implementation of these method is
  43      * provided by the particular AWT implementations
  44      * (i.e. "Toolkit"s/Peer), such as Motif, Win32 or Tiny. The
  45      * problem is that this means that the native libraries must be
  46      * loaded by the java.* classes, which do not necessarily know the
  47      * names of the libraries to load. A better way of doing this
  48      * would be to provide a separate library which defines java.awt.*
  49      * initIDs, and exports the relevant symbols out to the
  50      * implementation libraries.
  51      *
  52      * For now, we know it's done by the implementation, and we assume
  53      * that the name of the library is "awt".  -br.
  54      */
  55     static void loadLibraries() {
  56         java.security.AccessController.doPrivileged
  57                 (new sun.security.action.LoadLibraryAction("awt"));



  58     }


  59 }


  36      * package (sun.awt.image) have a native method, initIDs(),
  37      * which initializes
  38      * the JNI field and method ids used in the native portion of
  39      * their implementation.
  40      *
  41      * Since the use and storage of these ids is done by the
  42      * implementation libraries, the implementation of these method is
  43      * provided by the particular AWT implementations
  44      * (i.e. "Toolkit"s/Peer), such as Motif, Win32 or Tiny. The
  45      * problem is that this means that the native libraries must be
  46      * loaded by the java.* classes, which do not necessarily know the
  47      * names of the libraries to load. A better way of doing this
  48      * would be to provide a separate library which defines java.awt.*
  49      * initIDs, and exports the relevant symbols out to the
  50      * implementation libraries.
  51      *
  52      * For now, we know it's done by the implementation, and we assume
  53      * that the name of the library is "awt".  -br.
  54      */
  55     static void loadLibraries() {
  56         java.security.AccessController.doPrivileged(
  57             new java.security.PrivilegedAction<Void>() {
  58                 public Void run() {
  59                     System.loadLibrary("awt");
  60                     return null;
  61                 }
  62             });
  63     }
  64 }