cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r557913 - in /incubator/cxf/trunk: rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ systests/src/test/java/org/apache/cxf/systest/servlet/
Date Fri, 20 Jul 2007 07:48:04 GMT
Author: ningjiang
Date: Fri Jul 20 00:48:03 2007
New Revision: 557913

URL: http://svn.apache.org/viewvc?view=rev&rev=557913
Log:
Added some info log of CXFServlet, also removed useless codes of CXFServletTest

Modified:
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/Messages.properties
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/servlet/CXFServletTest.java

Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java?view=diff&rev=557913&r1=557912&r2=557913
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java
(original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java
Fri Jul 20 00:48:03 2007
@@ -24,6 +24,7 @@
 import java.lang.ref.WeakReference;
 import java.util.Hashtable;
 import java.util.Map;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.servlet.ServletConfig;
@@ -38,6 +39,7 @@
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.bus.spring.SpringBusFactory;
 import org.apache.cxf.common.classloader.ClassLoaderUtils;
+import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.resource.ResourceManager;
 import org.apache.cxf.resource.URIResolver;
 import org.apache.cxf.transport.DestinationFactory;
@@ -56,7 +58,7 @@
  */
 public class CXFServlet extends HttpServlet {
     static final Map<String, WeakReference<Bus>> BUS_MAP = new Hashtable<String,
WeakReference<Bus>>();
-    static final Logger LOG = Logger.getLogger(CXFServlet.class.getName());
+    static final Logger LOG = LogUtils.getL7dLogger(CXFServlet.class);
     
     private Bus bus;
     private ServletTransportFactory servletTransportFactory;
@@ -94,7 +96,7 @@
             try {
                 ClassLoaderUtils.loadClass(springCls, getClass());
                 loadSpringBus(servletConfig);
-            } catch (ClassNotFoundException e) {
+            } catch (ClassNotFoundException e) {                
                 loadBusNoConfig(servletConfig);
             }
                 
@@ -108,7 +110,9 @@
     }
     
     private void loadBusNoConfig(ServletConfig servletConfig) throws ServletException {
+        
         if (bus == null) {
+            LOG.info("LOAD_BUS_WITHOUT_APPLICATION_CONTEXT");
             bus = BusFactory.newInstance().createBus();
         }
         ResourceManager resourceManager = bus.getExtension(ResourceManager.class);
@@ -123,6 +127,7 @@
     }
 
     private void loadSpringBus(ServletConfig servletConfig) throws ServletException {
+        
         // try to pull an existing ApplicationContext out of the
         // ServletContext
         ServletContext svCtx = getServletContext();
@@ -138,10 +143,12 @@
         }
         
         // This constructor works whether there is a context or not
-        // If the ctx is null, we need to load the cxf-servlet as default
-        if (ctx == null) {
-            bus = new SpringBusFactory().createBus("/META-INF/cxf/cxf-servlet.xml");
+        // If the ctx is null, we just start up the default bus
+        if (ctx == null) {            
+            LOG.info("LOAD_BUS_WITHOUT_APPLICATION_CONTEXT");
+            bus = new SpringBusFactory().createBus();
         } else {
+            LOG.info("LOAD_BUS_WITH_APPLICATION_CONTEXT");
             bus = new SpringBusFactory(ctx).createBus();
         }
         ResourceManager resourceManager = bus.getExtension(ResourceManager.class);
@@ -179,7 +186,9 @@
         }
         
         if (is != null) {
+            LOG.log(Level.INFO, "BUILD_ENDPOINTS_FROM_CONFIG_LOCATION", new Object[]{location});
             childCtx = new GenericApplicationContext(ctx);
+            
             XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(childCtx);
             reader.setValidationMode(XmlBeanDefinitionReader.VALIDATION_XSD);
             reader.loadBeanDefinitions(new InputStreamResource(is, location));
@@ -203,12 +212,14 @@
     }
 
     private void replaceDestionFactory() throws ServletException {
+       
         DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);

         try {
             DestinationFactory df = dfm
                 .getDestinationFactory("http://cxf.apache.org/transports/http/configuration");
             if (df instanceof ServletTransportFactory) {
                 servletTransportFactory = (ServletTransportFactory)df;
+                LOG.info("DESTIONFACTORY_ALREADY_REGISTERED");
                 return;
             }
         } catch (BusException e) {
@@ -222,7 +233,8 @@
         registerTransport(factory, "http://www.w3.org/2003/05/soap/bindings/HTTP/");
         registerTransport(factory, "http://schemas.xmlsoap.org/wsdl/http/");
         registerTransport(factory, "http://cxf.apache.org/transports/http/configuration");
-        registerTransport(factory, "http://cxf.apache.org/bindings/xformat");        
+        registerTransport(factory, "http://cxf.apache.org/bindings/xformat"); 
+        LOG.info("REPLACED_HTTP_DESTIONFACTORY");
     }
 
     public void destroy() {

Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/Messages.properties?view=diff&rev=557913&r1=557912&r2=557913
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/Messages.properties
(original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/Messages.properties
Fri Jul 20 00:48:03 2007
@@ -18,5 +18,10 @@
 #    under the License.
 #
 #
+LOAD_BUS_WITHOUT_APPLICATION_CONTEXT = load the bus without application context
+LOAD_BUS_WITH_APPLICATION_CONTEXT = load the bus with application context
+REPLACED_HTTP_DESTIONFACTORY = replaced the http destionFactory with servlet transport factory
+BUILD_ENDPOINTS_FROM_CONFIG_LOCATION = build endpoints from config-location: {0}
+DESTIONFACTORY_ALREADY_REGISTERED = servlet transport factory already registered 
 UNEXPECTED_RESPONSE_TYPE_MSG = Unexpected response type {0}
 DECOUPLED_RESPONSE_FAILED_MSG = Decouple response failed

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/servlet/CXFServletTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/servlet/CXFServletTest.java?view=diff&rev=557913&r1=557912&r2=557913
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/servlet/CXFServletTest.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/servlet/CXFServletTest.java
Fri Jul 20 00:48:03 2007
@@ -52,10 +52,8 @@
     }
     
     @Test
-    public void testPostInvokeServices() throws Exception {        
+    public void testPostInvokeServices() throws Exception {
         
-        //Thread.sleep(6000000);
-        //newClient();        
         invoke("UTF-8");
         invoke("iso-8859-1");        
     }



Mime
View raw message