axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r552867 - /webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/util/ClassLoaderUtils.java
Date Tue, 03 Jul 2007 15:06:03 GMT
Author: gawor
Date: Tue Jul  3 08:06:02 2007
New Revision: 552867

URL: http://svn.apache.org/viewvc?view=rev&rev=552867
Log:
one more method

Modified:
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/util/ClassLoaderUtils.java

Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/util/ClassLoaderUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/util/ClassLoaderUtils.java?view=diff&rev=552867&r1=552866&r2=552867
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/util/ClassLoaderUtils.java
(original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/util/ClassLoaderUtils.java
Tue Jul  3 08:06:02 2007
@@ -35,6 +35,27 @@
     }
     
     /** @return ClassLoader */
+    public static ClassLoader getClassLoader(final Class cls) {
+        ClassLoader cl = null;
+        try {
+            cl = (ClassLoader)AccessController.doPrivileged(
+                    new PrivilegedExceptionAction() {
+                        public Object run() throws ClassNotFoundException {
+                            return cls.getClassLoader();
+                        }
+                    }
+            );
+        } catch (PrivilegedActionException e) {
+            if (log.isDebugEnabled()) {
+                log.debug("Exception thrown from AccessController: " + e);
+            }
+            throw ExceptionFactory.makeWebServiceException(e.getException());
+        }
+
+        return cl;
+    }
+    
+    /** @return ClassLoader */
     public static ClassLoader getContextClassLoader() {
         ClassLoader cl = null;
         try {
@@ -105,4 +126,5 @@
 
         return cl;
     }
+
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message