aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/jogamp/common
Commit message (Collapse)AuthorAgeFilesLines
* Add 'asset' URLConnection; IOUtil uses URLConnection / incr. effeciency; ↵Sven Gothel2012-03-172-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Android ClassLoaderUtil cleanup; - Add 'asset' URLConnection - Please read API doc 'PiggybackURLConnection' and 'AssetURLConnection' - Solves generic resource handling where platform locations may differ, ie ClassLoader lookup on Android in the 'assets/' subfolder. - New Android 'AssetDexClassLoader' uses 'assets/' folder for findResource(..) - aapt.signed (our APK ant task) - uses 'assets/' folder - adds the 'assetsdir' attribute allowing to copy other assets into the APK - IOUtil uses URLConnection / incr. effeciency - using URLConnection on all getResource(..) since URL is connected anyways for validation and URLConnection can be used by caller right away - String getRelativeOf(URL, String) -> URL getRelativeOf(URL, String) - preserves scheme, authority, etc - simple parentOf handling, more efficient - reusing new 'asset' protocol impl. - Android ClassLoaderUtil cleanup; - Use createClassLoader(..) impl for build-in static jogamp and user APKs, which removes code redundancy Tests: New code path, especially 'assets' are covered by new unit tests, no regressions on Linux.
* PropertyAccess: Push down 'isPropertyDefined(final String property, final ↵Sven Gothel2012-03-131-0/+4
| | | | | | boolean jnlpAlias)' for trusted properties The method shall be called by the respective Debug specialization, which registers the trusted property prefix.
* SecurityUtil: Generalize cert validation and AccessControlContext query; ↵Sven Gothel2012-03-132-165/+14
| | | | | | | | | | | | | | | | | | PropertyAccess: Fix security code, grant access to common 'trusted' properties - SecurityUtil - Generalize cert validation for JAR and property access - Grant access to common AccessControlContext for 'same' cert - PropertyAccess: - Fix security code: Passing the current AccessControlContext from the caller didn't include priviledges. - Grant access to common 'trusted' properties, which removes the need of passing the AccessControlContext for general properties like 'jnlp.', 'jogamp.' .. - Enable registering 'trusted' properties, when caller's cert is 'same'
* Intro.: PropertyAccess ; Added safe PropertyAccess for JNILibLoaderBase, ↵Sven Gothel2012-03-132-72/+148
| | | | | | | | | | | | | | | | | Platform, IOUtil, .. - Intro.: PropertyAccess - Base class of all Debug impl, reduces redundancies. - jnlpAlias'ed trusted property is queried within local AccessControlContext to avoid 'JRE' implementation differences (should not be required). - throw NPE and IllegalArgumentException for invalid property key - Added safe PropertyAccess - JNILibLoaderBase: sun.jnlp.applet.launcher - Platform: jogamp.gluegen.UseTempJarCache - IOUtil: java.io.tmpdir
* DynamicLibraryBundle (enhancement)Sven Gothel2012-02-123-19/+22
| | | | | | | - Hold DEBUG, DEBUG_LOOKUP in DynamicLookupHelper - Tool complete only if named tool's GetProcAddressFunc is avail - Allow no tool/glue lib's - Use DEBUG_LOCKUP for lockup symbol trace
* RecursiveThreadGroupLock: New recursive lock interface and impl, allowing ↵Sven Gothel2011-12-111-0/+211
| | | | | | | | | | | | 'spawn off' process to become the lock owner. To avoid complicated synchronization via synchronized, wait and notify between one thread and a 'spawn' off thread which temporarly requires the hold lock, RecursiveThreadGroupLock allows to add and remove other threads to become owners of the lock as if they were the original holder. This simplifies some rare locking use cases, eg. in JOGL's GLProfile initialization sequence where a SharedResourceRunner thread is taking over initialization of shared resources.
* Cleanup Lock Package: API doc, complete throws declaration, interface ↵Sven Gothel2011-12-113-43/+83
| | | | | | RecursiveLockImpl01Unfairish.Sync RecursiveLockImpl01Unfairish changes are in preparation of RecursiveGroupThreadLock.
* JVMUtil: Remove Platform dependency - It's being called by Platform and is ↵Sven Gothel2011-12-011-6/+3
| | | | private API.
* MachineDescriptor Static: Add Mac-OsX 32bit gcc4 special case with ↵Sven Gothel2011-10-241-0/+2
| | | | sizeof(long double) == 8
* Lock ChangeSet (fin): Cleanup, fix and enhance RecursiveLock implementationSven Gothel2011-09-274-122/+613
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - RecursiveLock _is_ interface. - Use LockFactory to create a RecursiveLock. - Impl: RecursiveLockImpl01Unfairish - just using notify w/o any queue: fast - still enqueuing new lock-applicants if queue full (nice) - lock's sync extends AbstractOwnableSynchronizer and uses it (monitor) - Impl: RecursiveLockImpl01CompleteFair - using queue and interrupt for correctness (slow) - lock's sync extends AbstractOwnableSynchronizer and uses it (monitor) - Impl: RecursiveLockImplJava5 for using Java5's concurrency impl. - to verify correctness, performance and deviation of locking time TestRecursiveLock01 new performance measurements incl. simple avrg and deviation shows best combined performance-deviation w/ our RecursiveLockImpl01Unfairish os Linux and MacOSX. RecursiveLockImpl01Unfairish is the default in LockFactory. Adding 'private' LockDebugUtil, allowing validating all holdings locks of one thread as stack traces (Throwable). Besides the AbstractOwnableSynchronizer utilization, this helps debugging deadlocks and starvation very well.
* Lock ChangeSet: Prepare RecursiveLock to be an implementation of it's new ↵Sven Gothel2011-09-271-0/+245
| | | | interface
* SingletonInstanceServerSocket: composite thread name w/ leading original oneSven Gothel2011-09-251-1/+8
|
* Add boolean system property 'jogamp.gluegen.UseTempJarCache', defaults to ↵Sven Gothel2011-09-231-4/+11
| | | | 'true' - allowing to disable usage of TempJarCache.
* Moved JVMUtil to private package; Invoke JVMUtil.initSingleton() from ↵Sven Gothel2011-09-231-0/+77
| | | | Platform static init after loading native library.
* gluegen-rt lib loading: Moved to Platform static init incl. ↵Sven Gothel2011-09-221-4/+23
| | | | | | | | | | | | | | | | TempJarCache.bootstrapNativeLib(..) usage - Moving to Platform solves former interdependencies between GlueGenJNILibLoader/Platform - TempJarCache is being setup w/ bootstraping the gluegen-rt native lib jar file. Interesting here is that when using Oracle's JRE w/ Applets/JNLP the current dbg output is: gluegen-rt: url-root http://risa/deployment/test/jau02s/jar/ gluegen-rt: nativeJarURL jar:http://risa/deployment/test/jau02s/jar/gluegen-rt-natives-linux-amd64.jar!/ gluegen-rt: nativeJar /home/sven/.java/deployment/cache/6.0/49/3c6d1e31-2c90f42e IE the JRE implementation already deduces the online link to the Applet/JNLP cache. This makes the implementation much simpler, ie. same for application and Applets/JNLP. Have to verify w/ other Java impl. sure - and add same logic for the JOGL part.
* Unify JNI Library Loading into JNILibLoaderBase and use it for the ↵Sven Gothel2011-09-211-2/+2
| | | | | | | | gluegen-rt native lib as well - removed redundance - move proper JNLPAppletLauncher custom libloader code into JNILibLoaderBase - prepares for new JAR temp cache ..
* Remove redundant: NativeLibrary.ensureNativeLibLoaded()Sven Gothel2011-09-201-1/+2
|
* Fix Bug 510 w/ Wade Walker's proposal. However, the EGL global lookup ↵Sven Gothel2011-08-221-2/+6
| | | | setting will be changed in JOGL as well
* Android: Extract static context holderSven Gothel2011-08-063-11/+50
|
* Hide DynamicLinker impl.; Remove public AndroidPackageUtil ; ↵Sven Gothel2011-08-034-2/+212
| | | | | | | GluegenVersionActivity uses ApplicationContext Hide DynamicLinker impl.: - com.jogamp.common.os.*DynamicLinkerImpl -> jogamp.common.os
* Fix Android apk activity; Add apk VersionName; Add jar manifest to apkSven Gothel2011-07-284-1/+216
| | | | | | | | | | | | | | | | - build: - exclude android packages if !isAndroid - aapt: - Use individual AndroidManifest xml files - optional: incl. our JAR manifest file to support detailed version info - use def. GluegenVersionActivity - APK VersionName: Retrieve and show - package/extension names: - gluegen.jar/apk: com.jogamp.gluegen - gluegen-rt.jar/apk: com.jogamp.common
* Android: Remove native (fake) detectionSven Gothel2011-07-241-11/+0
|
* Android integration / cross-test ; Enhance PlatformSven Gothel2011-07-241-0/+12
| | | | | | | | | | | - android minor build fix - started dex'ing (gluegen-rt.apk, more to come for full junit tests) - android remote dalvikvm launch works (crosstest-java-android-armv7-rel.sh) - android detection, incl version (reflection) - Platform: - Add JAVA_VM_NAME and JAVA_VM_RUNIME - OSType maybe ANDROID, where the OS name (String) is Linux ! (ok ?)
* GlueGen proper size / alignment of primitive and compound types usage [2/2] ↵Sven Gothel2011-07-211-31/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | - Fin MachineDesction == MD MD.StaticConfig: - enum for all supported static configs (ID -> MD) - verified at runtime: test runtime queried-MD versus static-MD, hard fail if not compatible (size/alignment) SizeThunk primitive sizes: - Add notion of fixed native size (eg. int64_t) and otherwise (eg. long) java struct 'wrappers' code generation: - single class using size/offset arrays of all MachineDescription configurations - at runtime the array idx is queried in static block - type aligment for not fixed-native-size types (SizeThunk, undef long/int) via StructAccessor junit test: - add float test - fix native code - add java (create, write) -> native (verify) test works (tested) on: linux 32/64 and windows 32/64
* Cleanup: Platform CPU enum, MachineDescription,Sven Gothel2011-07-203-138/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Platform: - enum CPUFamily is part of CPUType - DALVIK -> ANDROID - ARM: ARM + ARMv[567] MachineDescription - self contained - static size/alignment Config (enum) for unix32, unix64, win32, win64 and armeabi - add 'long double' - Removed MachineDescription32Bit, MachineDescription64Bit - createStatic(..) uses OS/CPU to fetch best match if not at runtime FIXES: JavaEmitter's struct-emit: Proper 32/64 struct sizes TODO: StructAccessor's mapping to <Type>Buffer w/ index os sizeof(<Type>) doesn't work, since offset may not be multiple of sizeof(<Type>)! i.e. typedef struct { int8_t bits1; // +1 - 0 // +3 (p32) int32_t id; // +4 - 4 int8_t bits2; // +1 - 8 // +3 (p32) - int64_t long0; // +8 - 12 so "longBuffer.get(<type-sized index>)" is invalid, but "byteBuffer.getLong(<byte index>)" must be done. The actual impl. doesn't matter, hence dropping the other nio type mappings is good.
* GlueGen: Alignment Cleanup ..Sven Gothel2011-07-173-16/+12
| | | | | | | | | | - SizeThunk - rename: compute -> computeSize - add: computeAlignment - merge types: char -> int8, short -> int16 - 'int' and 'long' may differ -
* GlueGen proper size / alignment of primitive and compound types usage [1/2] ↵Sven Gothel2011-07-171-0/+120
| | | | | | | - Preparation. Fix commit f733203dfbd034a6b1aa3eb2cd616437c982c435, adding missing file src/java/jogamp/common/os/MachineDescriptionRuntime.java
* GlueGen proper size / alignment of primitive and compound types usage [1/2] ↵Sven Gothel2011-07-172-0/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Preparation. Currently GlueGen fails for type long (size) and some alignments (see package.html). - The size and alignment values shall be queried at runtime. - Compound alignment needs to follow the described natural alignment (also @runtime). - - Build - add Linux Arm7 (EABI) - junit test - added compound/struct tests, pointing out the shortcomings of current impl. - package.html - Added alignment documentation - remove intptr.cfg - add GluGen types int8_t, int16_t, uint8_t, uint16_t - move MachineDescription* into runtime - Platform - has runtime MachineDescription - moved size, .. to MachineDescription - use enums for OSType, CPUArch and CPUType defined by os.name/os.arch, triggering exception if os/arch is not supported. This avoids Java String comparison and conscious os/arch detection. - MachineDescription: - compile time instances MachineDescription32Bits, MachineDescription64Bits - runtime queried instance MachineDescriptionRuntime - correct size, alignment, page size, ..
* SingletonInstanceServerSocket: Fix setDaemon(true), give Thread a proper nameSven Gothel2011-06-121-2/+2
|
* SingletonInstance Enhancements / Minor Lock/LockExt API Change (isLocked ↵Sven Gothel2011-06-112-0/+351
| | | | | | | | | | | | | | | moved up) We learned that FileChannel.lock() is not reliable on at least GNU/Linux + Sun's JVM implementation, hence we need a ServerSocket implementation. Since this code may be useful to others, it has been promoted to GlueGen. - Abstract SingletonInstance - Implement Lock interface - SingletonInstance Spezialisation: FileLock and ServerSocket Minor API Change: LockExt.isLocked() -> Lock.isLocked()
* Move implementation private files from com.jogamp.<module>.impl. to ↵Sven Gothel2011-02-091-0/+149
jogamp.<module> - com.jogamp.common.impl -> jogamp.common This sorts implementation details from the top level, ie skipping the public 'com', allowing a better seperation of public classes and implementation details and also reduces strings. This approach of public/private seperation is also used in the OpenJDK.