abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r656943 - /incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/ServiceUtil.java
Date Fri, 16 May 2008 05:58:16 GMT
Author: jmsnell
Date: Thu May 15 22:58:15 2008
New Revision: 656943

URL: http://svn.apache.org/viewvc?rev=656943&view=rev
Log:
add a setClassLoader method to ServiceUtil. This will allow the classloader to be set explicitly
rather than always assuming that the context class loader will be used

Modified:
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/ServiceUtil.java

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/ServiceUtil.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/ServiceUtil.java?rev=656943&r1=656942&r2=656943&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/ServiceUtil.java
(original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/ServiceUtil.java
Thu May 15 22:58:15 2008
@@ -44,6 +44,8 @@
 public final class ServiceUtil 
   implements Constants {
   
+  private static ClassLoader classLoader = null;
+  
   ServiceUtil() {}
   
   /**
@@ -132,7 +134,13 @@
    * Get the context class loader for this thread
    */
   public static ClassLoader getClassLoader() {
-    return Thread.currentThread().getContextClassLoader();
+    if (classLoader == null)
+      classLoader = Thread.currentThread().getContextClassLoader();
+    return classLoader;
+  }
+  
+  public static void setClassLoader(ClassLoader classLoader) {
+    ServiceUtil.classLoader = classLoader;
   }
   
   public static Object locate(



Mime
View raw message