summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2011-07-12 08:19:31 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2011-07-12 08:19:31 +0000
commit7f402cca25b2ca3836734c5ed31aea3a461003f0 (patch)
tree5ff60ef898d42e5c293459abc81394483aca1f25 /sca-java-2.x/trunk
parent0982e5213d018fdefc6acbf8601e10bb15b35072 (diff)
Add a doPrivileged around getContextClassLoader() so that it works with security enabled
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1145485 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk')
-rw-r--r--sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/client/impl/SCAClientFactoryFinderImpl.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/client/impl/SCAClientFactoryFinderImpl.java b/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/client/impl/SCAClientFactoryFinderImpl.java
index 5549091262..398360813d 100644
--- a/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/client/impl/SCAClientFactoryFinderImpl.java
+++ b/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/client/impl/SCAClientFactoryFinderImpl.java
@@ -4,8 +4,6 @@
*/
package org.oasisopen.sca.client.impl;
-import org.oasisopen.sca.client.SCAClientFactoryFinder;
-
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
@@ -14,11 +12,14 @@ import java.io.InputStreamReader;
import java.lang.reflect.Constructor;
import java.net.URI;
import java.net.URL;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.Properties;
import org.oasisopen.sca.NoSuchDomainException;
import org.oasisopen.sca.ServiceRuntimeException;
import org.oasisopen.sca.client.SCAClientFactory;
+import org.oasisopen.sca.client.SCAClientFactoryFinder;
/**
* This is a default implementation of an SCAClientFactoryFinder which is
@@ -88,9 +89,11 @@ public class SCAClientFactoryFinderImpl implements SCAClientFactoryFinder {
* @return The Context ClassLoader for the current Thread.
*/
private static ClassLoader getThreadContextClassLoader () {
- final ClassLoader threadClassLoader =
- Thread.currentThread().getContextClassLoader();
- return threadClassLoader;
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+ public ClassLoader run() {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
}
/**