cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1154232 - /cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletContextResourceResolver.java
Date Fri, 05 Aug 2011 14:15:40 GMT
Author: sergeyb
Date: Fri Aug  5 14:15:40 2011
New Revision: 1154232

URL: http://svn.apache.org/viewvc?rev=1154232&view=rev
Log:
[CXF-3713] Reverting reflection-based code but retaining Throwable catch

Modified:
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletContextResourceResolver.java

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletContextResourceResolver.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletContextResourceResolver.java?rev=1154232&r1=1154231&r2=1154232&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletContextResourceResolver.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletContextResourceResolver.java
Fri Aug  5 14:15:40 2011
@@ -22,16 +22,15 @@ package org.apache.cxf.transport.servlet
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
-import java.lang.reflect.Method;
 import java.net.MalformedURLException;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
+import javax.naming.InitialContext;
 import javax.servlet.ServletContext;
 
-import org.apache.cxf.common.classloader.ClassLoaderUtils;
 import org.apache.cxf.resource.ResourceResolver;
 
 
@@ -60,14 +59,11 @@ public class ServletContextResourceResol
         Object obj = null;
         try {
             if (entryName != null) {
-                Object ic = ClassLoaderUtils.loadClass("javax.naming.InitialContext", 
-                                                        this.getClass());
+                InitialContext ic = new InitialContext();
                 try {
-                    Method lookupMethod = ic.getClass().getMethod("lookup", new Class[]{String.class});
-                    obj = lookupMethod.invoke(ic, new Object[]{entryName});
+                    obj = ic.lookup(entryName);
                 } finally {
-                    Method closeMethod = ic.getClass().getMethod("close", new Class[]{});
-                    closeMethod.invoke(ic, new Object[]{});
+                    ic.close();
                 }
             }
         } catch (Throwable e) {



Mime
View raw message