diff options
author | Kevin Rushforth <[email protected]> | 2004-11-01 19:21:31 +0000 |
---|---|---|
committer | Kevin Rushforth <[email protected]> | 2004-11-01 19:21:31 +0000 |
commit | a0154c99b208bfb73a13190d50ecccf331ce5c3c (patch) | |
tree | 6a88b696ebbd7310aaa7d29df2d44d398e85628e /src | |
parent | 36b981685cc1633e24c4622399b95428d89df002 (diff) |
Use System ClassLoader for loading audio engine when j3d.audioengine
property is specified
git-svn-id: https://svn.java.net/svn/j3d-core-utils~svn/trunk@27 9497e636-51bd-65ba-982d-a4982e1767a5
Diffstat (limited to 'src')
-rw-r--r-- | src/classes/share/com/sun/j3d/utils/universe/Viewer.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/classes/share/com/sun/j3d/utils/universe/Viewer.java b/src/classes/share/com/sun/j3d/utils/universe/Viewer.java index 207ce08..fa631fc 100644 --- a/src/classes/share/com/sun/j3d/utils/universe/Viewer.java +++ b/src/classes/share/com/sun/j3d/utils/universe/Viewer.java @@ -979,7 +979,20 @@ public class Viewer { throw new UnsupportedOperationException("No AudioDevice specified"); } - Class audioDeviceClass = Class.forName(audioDeviceClassName); + ClassLoader audioDeviceClassLoader = + (ClassLoader) java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public Object run() { + return ClassLoader.getSystemClassLoader(); + } + }); + + if (audioDeviceClassLoader == null) { + throw new IllegalStateException("System ClassLoader is null"); + } + + Class audioDeviceClass = + Class.forName(audioDeviceClassName, true, audioDeviceClassLoader); Class physEnvClass = PhysicalEnvironment.class; Constructor audioDeviceConstructor = audioDeviceClass.getConstructor(new Class[] {physEnvClass}); |