cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1052200 - in /cxf/trunk: rt/core/src/main/java/org/apache/cxf/service/factory/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ systests/jaxws/src/test/java/org/apache/c...
Date Thu, 23 Dec 2010 09:02:01 GMT
Author: ema
Date: Thu Dec 23 09:02:01 2010
New Revision: 1052200

URL: http://svn.apache.org/viewvc?rev=1052200&view=rev
Log:
[CXF-3209]:Added NeedReset boolean flag in ServiceFactory to avoid creating service twice
when the port is get without portName

Modified:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
    cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java?rev=1052200&r1=1052199&r2=1052200&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java
Thu Dec 23 09:02:01 2010
@@ -49,6 +49,7 @@ public abstract class AbstractServiceFac
     private static final Logger LOG = LogUtils.getL7dLogger(AbstractServiceFactoryBean.class);
     
     protected boolean dataBindingSet;
+    protected boolean needReset = true;
     protected List<String> schemaLocations;
 
     private Bus bus;
@@ -119,6 +120,10 @@ public abstract class AbstractServiceFac
         this.dataBindingSet = dataBinding != null;
     }
 
+    public void setNeedReset(boolean reset) {
+        needReset = reset;
+    }
+    
     public Service getService() {
         return service;
     }

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java?rev=1052200&r1=1052199&r2=1052200&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java Thu Dec
23 09:02:01 2010
@@ -433,8 +433,10 @@ public class ServiceImpl extends Service
             Service service = serviceFactory.getService();
             if (service == null) {
                 serviceFactory.setServiceClass(serviceEndpointInterface);
-                serviceFactory.setBus(getBus());                
+                serviceFactory.setBus(getBus());
                 service = serviceFactory.create();
+                //Add this flag and not need to create service twice
+                serviceFactory.setNeedReset(false);
             }
             
             EndpointInfo ei = ServiceModelUtil.findBestEndpointInfo(portTypeName, service.getServiceInfos());

Modified: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=1052200&r1=1052199&r2=1052200&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
(original)
+++ cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Thu Dec 23 09:02:01 2010
@@ -226,6 +226,9 @@ public class ReflectionServiceFactoryBea
         return retVal;
     }
     public void reset() {
+        if (!needReset) {
+            return;
+        }
         if (!dataBindingSet) {
             setDataBinding(null);
         }

Modified: cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java?rev=1052200&r1=1052199&r2=1052200&view=diff
==============================================================================
--- cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
(original)
+++ cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
Thu Dec 23 09:02:01 2010
@@ -1003,4 +1003,21 @@ public class ClientServerTest extends Ab
         ins.close();
     }
     
+    @Test
+    public void testGetPortWithoutPortName() throws Exception {
+        SOAPService service = new SOAPService();
+        assertNotNull(service);
+        Greeter greeter = service.getPort(Greeter.class);
+        updateAddressPort(greeter, PORT);
+        try {
+            greeter.greetMe("test");           
+            String reply = greeter.sayHi();
+            assertNotNull("no response received from service", reply);
+            assertEquals("Bonjour", reply);
+        } catch (UndeclaredThrowableException ex) {
+            throw (Exception)ex.getCause();
+        }
+    }
+    
+    
 }



Mime
View raw message