From a0154c99b208bfb73a13190d50ecccf331ce5c3c Mon Sep 17 00:00:00 2001 From: Kevin Rushforth Date: Mon, 1 Nov 2004 19:21:31 +0000 Subject: 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 --- src/classes/share/com/sun/j3d/utils/universe/Viewer.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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}); -- cgit v1.2.3