@Override public void loadLibrary(final String libname, final String[] preload, final boolean preloadIgnoreError, final ClassLoader cl) { if(!isLoaded(libname)) { if (null!=preload) { for (int i=0; i<preload.length; i++) { loadLibrary(preload[i], preloadIgnoreError, cl); } } loadLibrary(libname, false, cl); } } }
public static void enableLoading() { setLoadingAction(new DefaultAction()); }
protected static synchronized boolean loadLibrary(final String libname, final boolean ignoreError, final ClassLoader cl) { return JNILibLoaderBase.loadLibrary(libname, ignoreError, cl); } }
@Override public Boolean run() { Platform.initSingleton(); final String libName = "newt"; if(TempJarCache.isInitialized() && null == TempJarCache.findLibrary(libName)) { JNILibLoaderBase.addNativeJarLibsJoglCfg(new Class<?>[] { jogamp.nativewindow.Debug.class, jogamp.newt.Debug.class }); } return Boolean.valueOf(loadLibrary(libName, false, NEWTJNILibLoader.class.getClassLoader())); } }).booleanValue();
/** * Loads and adds a JAR file's native library to the TempJarCache, * calling {@link JNILibLoaderBase#addNativeJarLibs(Class[], String)} * with default JOGL deployment configuration: * <pre> return JNILibLoaderBase.addNativeJarLibs(classesFromJavaJars, "-all"); * </pre> * If <code>Class1.class</code> is contained in a JAR file which name includes <code>singleJarMarker</code> <i>-all</i>, * implementation will attempt to resolve the native JAR file as follows: * <ul> * <li><i>ClassJar-all</i>.jar to <i>ClassJar-all</i>-natives-<i>os.and.arch</i>.jar</li> * </ul> * Otherwise the native JAR files will be resolved for each class's JAR file: * <ul> * <li><i>ClassJar1</i>.jar to <i>ClassJar1</i>-natives-<i>os.and.arch</i>.jar</li> * <li><i>ClassJar2</i>.jar to <i>ClassJar2</i>-natives-<i>os.and.arch</i>.jar</li> * <li>..</li> * </ul> */ public static final boolean addNativeJarLibsJoglCfg(final Class<?>[] classesFromJavaJars) { return addNativeJarLibs(classesFromJavaJars, "-all"); }
@Override public boolean loadLibrary(final String libname, final boolean ignoreError, final ClassLoader cl) { boolean res = true; if(!isLoaded(libname)) { try { loadLibraryInternal(libname, cl); addLoaded(libname); if(DEBUG) { System.err.println("JNILibLoaderBase: loaded "+libname); } } catch (final UnsatisfiedLinkError e) { res = false; if(DEBUG) { e.printStackTrace(); } if (!ignoreError && e.getMessage().indexOf("already loaded") < 0) { throw e; } } } return res; }
/** * Loads the library specified by libname, using the {@link LoaderAction} set by {@link #setLoadingAction(LoaderAction)}.<br> * The implementation should ignore, if the library has been loaded already.<br> * @param libname the library to load * @param ignoreError if true, errors during loading the library should be ignored * @param cl optional ClassLoader, used to locate the library * @return true if library loaded successful */ protected static synchronized boolean loadLibrary(final String libname, final boolean ignoreError, final ClassLoader cl) { if (loaderAction != null) { return loaderAction.loadLibrary(libname, ignoreError, cl); } return false; }
public static void disableLoading() { setLoadingAction(null); }
ok = addNativeJarLibsWithTempJarCache(classesFromJavaJars, singleJarMarker); } else if(DEBUG) { System.err.println("JNILibLoaderBase: addNativeJarLibs0: disabled due to uninitialized TempJarCache");
ok = JNILibLoaderBase.addNativeJarLibsImpl(c, classJarURI, jarName, nativeJarBasename); if (ok) { count++;
@Override public Boolean run() { Platform.initSingleton(); final String libName = "nativewindow_"+ossuffix ; if(TempJarCache.isInitialized() && null == TempJarCache.findLibrary(libName)) { JNILibLoaderBase.addNativeJarLibsJoglCfg(new Class<?>[] { jogamp.nativewindow.Debug.class }); } return Boolean.valueOf(loadLibrary(libName, false, NWJNILibLoader.class.getClassLoader())); } }).booleanValue();
public Object run() { Platform.initSingleton(); if( TempJarCache.isInitialized() ) { // only: jocl.jar -> jocl-natives-<os.and.arch>.jar JNILibLoaderBase.addNativeJarLibs(new Class<?>[] { jogamp.opencl.Debug.class }, null ); } return null; } });
/** * Loads the library specified by libname, using the {@link LoaderAction} set by {@link #setLoadingAction(LoaderAction)}.<br> * Optionally preloads the libraries specified by preload.<br> * The implementation should ignore, if any library has been loaded already.<br> * @param libname the library to load * @param preload the libraries to load before loading the main library if not null * @param preloadIgnoreError if true, errors during loading the preload-libraries should be ignored * @param cl optional ClassLoader, used to locate the library */ protected static synchronized void loadLibrary(final String libname, final String[] preload, final boolean preloadIgnoreError, final ClassLoader cl) { if (loaderAction != null) { loaderAction.loadLibrary(libname, preload, preloadIgnoreError, cl); } }
@Override public Boolean run() { Platform.initSingleton(); final String libName = "nativewindow_"+ossuffix ; if(TempJarCache.isInitialized() && null == TempJarCache.findLibrary(libName)) { JNILibLoaderBase.addNativeJarLibsJoglCfg(new Class<?>[] { jogamp.nativewindow.Debug.class }); } return Boolean.valueOf(loadLibrary(libName, false, NWJNILibLoader.class.getClassLoader())); } }).booleanValue();
public Object run() { Platform.initSingleton(); if(TempJarCache.isInitialized()) { // only: joal.jar -> joal-natives-<os.and.arch>.jar JNILibLoaderBase.addNativeJarLibs(new Class<?>[] { jogamp.openal.Debug.class }, null ); } return null; } });
@Override public Boolean run() { Platform.initSingleton(); final String libName = "newt"; if(TempJarCache.isInitialized() && null == TempJarCache.findLibrary(libName)) { JNILibLoaderBase.addNativeJarLibsJoglCfg(new Class<?>[] { jogamp.nativewindow.Debug.class, jogamp.newt.Debug.class }); } return Boolean.valueOf(loadLibrary(libName, false, NEWTJNILibLoader.class.getClassLoader())); } }).booleanValue();
JNILibLoaderBase.addNativeJarLibs(new Class<?>[] { jogamp.common.Debug.class }, null); } catch (final Exception e0) {
@Override public Object run() { Platform.initSingleton(); if(TempJarCache.isInitialized()) { final ClassLoader cl = GLProfile.class.getClassLoader(); final String newtDebugClassName = "jogamp.newt.Debug"; final Class<?>[] classesFromJavaJars = new Class<?>[] { jogamp.nativewindow.Debug.class, jogamp.opengl.Debug.class, null }; if( ReflectionUtil.isClassAvailable(newtDebugClassName, cl) ) { classesFromJavaJars[2] = ReflectionUtil.getClass(newtDebugClassName, false, cl); } JNILibLoaderBase.addNativeJarLibsJoglCfg(classesFromJavaJars); } initProfilesForDefaultDevices(); return null; } });
@Override public Object run() { Platform.initSingleton(); if(TempJarCache.isInitialized()) { final ClassLoader cl = GLProfile.class.getClassLoader(); final String newtDebugClassName = "jogamp.newt.Debug"; final Class<?>[] classesFromJavaJars = new Class<?>[] { jogamp.nativewindow.Debug.class, jogamp.opengl.Debug.class, null }; if( ReflectionUtil.isClassAvailable(newtDebugClassName, cl) ) { classesFromJavaJars[2] = ReflectionUtil.getClass(newtDebugClassName, false, cl); } JNILibLoaderBase.addNativeJarLibsJoglCfg(classesFromJavaJars); } initProfilesForDefaultDevices(); return null; } });
@Override public Object run() { Platform.initSingleton(); if(TempJarCache.isInitialized()) { final ClassLoader cl = GLProfile.class.getClassLoader(); final String newtDebugClassName = "jogamp.newt.Debug"; final Class<?>[] classesFromJavaJars = new Class<?>[] { jogamp.nativewindow.Debug.class, jogamp.opengl.Debug.class, null }; if( ReflectionUtil.isClassAvailable(newtDebugClassName, cl) ) { classesFromJavaJars[2] = ReflectionUtil.getClass(newtDebugClassName, false, cl); } JNILibLoaderBase.addNativeJarLibsJoglCfg(classesFromJavaJars); } initProfilesForDefaultDevices(); return null; } });