Bug 215

Summary: Enhancement for NativeLibLoader
Product: [JogAmp] Jogl Reporter: Sven Gothel <sgothel>
Component: coreAssignee: Sven Gothel <sgothel>
Status: VERIFIED FIXED    
Severity: normal    
Priority: P3    
Version: 1   
Hardware: All   
OS: all   
Type: FEATURE SCM Refs:
Workaround: ---
Attachments: patch for NativeLibLoader against CVS HEAD
the patched NativeLibLoader.java file

Description Sven Gothel 2010-03-24 07:48:41 CET


---- Reported by s_koehler 2006-04-09 11:32:14 ----

Hi,

in Issue 110 (https://jogl.dev.java.net/bugs/show_bug.cgi?id=110) i
sugguested, that people should be able to disable libloading. The goal was, to
be abled to provide an own way of library-loading - library loading without
using complicated ClassLoader techniques. 

Now, the number of libraries has been growing and the logic, when which library
is needed, are more complicated.

I have therefor decided to rewrite the NativeLibLoader so that it offers a
mechanism hook into the on-demand-loading of the libraries.

Important points concerning the rewrite:
- NativeLibLoader now consequently uses synchronized, no volatile things
(i don't think, that there is any noticable performance penality, since most of
loadXY()-methods are called only once during the live-time of the application)
- NativeLibLoader now offers a loadCGImpl()-method to replace the direct call to
System.loadLibrary("jogl_cg") within make/cg-common-CustomJavaCode.java
- A workaround for a JVM-Bug has been added, namely:
If you use bin\java.exe instead of jre\bin\java.exe to run a program with
System.loadLibrary("jawt"), then the JVM complaines about a missing awt.dll



---- Additional Comments From s_koehler 2006-04-09 11:32:55 ----

Created an attachment
patch for NativeLibLoader against CVS HEAD




---- Additional Comments From s_koehler 2006-04-09 11:34:18 ----

Created an attachment
the patched NativeLibLoader.java file




---- Additional Comments From s_koehler 2006-04-09 12:16:05 ----

Just another comment:

i used the line "Frame.getFrames();" to reference AWT, so that the awt.dll gets
loaded. If you know any better line, then use it. Another line that works is
"new Component() {};".



---- Additional Comments From kbr 2006-04-17 01:25:05 ----

Incorporated and cleaned up Cg library loading -- thanks for the patch.




--- Bug imported by sgothel@jausoft.com 2010-03-24 07:48 EDT  ---

This bug was previously known as _bug_ 215 at https://jogl.dev.java.net/bugs/show_bug.cgi?id=215
Imported an attachment (id=78)
Imported an attachment (id=79)

The original submitter of attachment 78 [details] is unknown.
   Reassigning to the person who moved it here: sgothel@jausoft.com.
The original submitter of attachment 79 [details] is unknown.
   Reassigning to the person who moved it here: sgothel@jausoft.com.