Return-Path: Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: (qmail 62006 invoked from network); 23 Dec 2010 09:02:24 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 23 Dec 2010 09:02:24 -0000 Received: (qmail 18569 invoked by uid 500); 23 Dec 2010 09:02:23 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 18461 invoked by uid 500); 23 Dec 2010 09:02:23 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 18450 invoked by uid 99); 23 Dec 2010 09:02:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Dec 2010 09:02:23 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Dec 2010 09:02:22 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 1183723889ED; Thu, 23 Dec 2010 09:02:02 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@cxf.apache.org From: ema@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101223090202.1183723889ED@eris.apache.org> 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 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(); + } + } + + }