Index: NativeLibLoader.java =================================================================== RCS file: /cvs/jogl/src/classes/com/sun/opengl/impl/NativeLibLoader.java,v retrieving revision 1.5 diff -u -r1.5 NativeLibLoader.java --- NativeLibLoader.java 16 Feb 2006 02:49:27 -0000 1.5 +++ NativeLibLoader.java 9 Apr 2006 18:15:11 -0000 @@ -39,88 +39,118 @@ package com.sun.opengl.impl; -import java.awt.Toolkit; -import java.security.*; +import java.awt.Frame; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.util.HashSet; public class NativeLibLoader { - private static volatile boolean doLoading = true; + public interface LoaderAction { + /** + * Loads the library specified by libname. Optionally preloads the libraries specified by + * preload. The implementation should ignore, if the preload-libraries have already been + * loaded. + * @param libname the library to load + * @param preload the libraries to load before loading the main library + * @param doPreload true, iff the preload-libraries should be loaded + * @param ignoreError true, iff errors during loading the preload-libraries should be ignored + */ + void loadLibrary(String libname, String[] preload, + boolean doPreload, boolean ignoreError); + } + + private static class DefaultAction implements LoaderAction { + public void loadLibrary(String libname, String[] preload, + boolean doPreload, boolean ignoreError) { + if (doPreload) { + for (int i=0; i