Return-Path: Delivered-To: apmail-incubator-cxf-commits-archive@locus.apache.org Received: (qmail 77420 invoked from network); 11 Mar 2008 02:57:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Mar 2008 02:57:40 -0000 Received: (qmail 21124 invoked by uid 500); 11 Mar 2008 02:57:37 -0000 Delivered-To: apmail-incubator-cxf-commits-archive@incubator.apache.org Received: (qmail 21059 invoked by uid 500); 11 Mar 2008 02:57:36 -0000 Mailing-List: contact cxf-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-commits@incubator.apache.org Received: (qmail 21050 invoked by uid 99); 11 Mar 2008 02:57:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Mar 2008 19:57:36 -0700 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.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Mar 2008 02:56:56 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 966171A9832; Mon, 10 Mar 2008 19:57:15 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r635786 - in /incubator/cxf/branches/2.0.x-fixes: ./ rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ rt/transports/http/src/main/java/org/apache/cxf/transport/http/ Date: Tue, 11 Mar 2008 02:57:14 -0000 To: cxf-commits@incubator.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080311025715.966171A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dkulp Date: Mon Mar 10 19:57:11 2008 New Revision: 635786 URL: http://svn.apache.org/viewvc?rev=635786&view=rev Log: Merged revisions 634052 via svnmerge from https://svn.apache.org/repos/asf/incubator/cxf/trunk ........ r634052 | dkulp | 2008-03-05 17:09:05 -0500 (Wed, 05 Mar 2008) | 2 lines Be a little more defensive against null addresses in the Conduit. Create invoker up front to avoid it being created twice. ........ Modified: incubator/cxf/branches/2.0.x-fixes/ (props changed) incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java incubator/cxf/branches/2.0.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java Propchange: incubator/cxf/branches/2.0.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java?rev=635786&r1=635785&r2=635786&view=diff ============================================================================== --- incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java (original) +++ incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java Mon Mar 10 19:57:11 2008 @@ -104,6 +104,11 @@ if (serviceBean != null && getServiceClass() == null) { setServiceClass(serviceBean.getClass()); } + if (invoker != null) { + getServiceFactory().setInvoker(invoker); + } else if (serviceBean != null) { + getServiceFactory().setInvoker(createInvoker()); + } Endpoint ep = createEndpoint(); server = new ServerImpl(getBus(), Modified: incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=635786&r1=635785&r2=635786&view=diff ============================================================================== --- incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java (original) +++ incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java Mon Mar 10 19:57:11 2008 @@ -657,6 +657,10 @@ } } protected Invoker createInvoker() { + Class cls = getServiceClass(); + if (cls.isInterface()) { + return null; + } return new FactoryInvoker(new LocalFactory(getServiceClass()), new ApplicationScopePolicy()); } Modified: incubator/cxf/branches/2.0.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?rev=635786&r1=635785&r2=635786&view=diff ============================================================================== --- incubator/cxf/branches/2.0.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java (original) +++ incubator/cxf/branches/2.0.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java Mon Mar 10 19:57:11 2008 @@ -192,17 +192,13 @@ */ private final EndpointInfo endpointInfo; - /** - * This field holds the "default" address for this particular conduit, which - * is set at construction. - */ - private final String defaultEndpointAddress; /** * This field holds the "default" URL for this particular conduit, which * is created on demand. */ private URL defaultEndpointURL; + private boolean fromEndpointReferenceType; private Destination decoupledDestination; private MessageObserver decoupledObserver; @@ -290,9 +286,9 @@ bus = b; endpointInfo = ei; - defaultEndpointAddress = t == null - ? ei.getAddress() - : t.getAddress().getValue(); + if (t != null) { + fromEndpointReferenceType = true; + } initializeConfig(); } @@ -666,11 +662,13 @@ * @throws MalformedURLException */ private URL setupURL(Message message) throws MalformedURLException { - String value = (String)message.get(Message.ENDPOINT_ADDRESS); + String result = (String)message.get(Message.ENDPOINT_ADDRESS); String pathInfo = (String)message.get(Message.PATH_INFO); String queryString = (String)message.get(Message.QUERY_STRING); - - String result = value != null ? value : getURL().toString(); + if (result == null) { + result = getURL().toString(); + + } // REVISIT: is this really correct? if (null != pathInfo && !result.endsWith(pathInfo)) { @@ -724,7 +722,12 @@ * @return the default target address */ protected String getAddress() throws MalformedURLException { - return defaultEndpointAddress; + if (defaultEndpointURL != null) { + return defaultEndpointURL.toExternalForm(); + } else if (fromEndpointReferenceType) { + return getTarget().getAddress().getValue(); + } + return endpointInfo.getAddress(); } /** @@ -741,7 +744,14 @@ protected synchronized URL getURL(boolean createOnDemand) throws MalformedURLException { if (defaultEndpointURL == null && createOnDemand) { - defaultEndpointURL = new URL(defaultEndpointAddress); + if (fromEndpointReferenceType && getTarget().getAddress().getValue() != null) { + defaultEndpointURL = new URL(this.getTarget().getAddress().getValue()); + return defaultEndpointURL; + } + if (endpointInfo.getAddress() == null) { + throw new MalformedURLException("Invalid address. Endpoint address cannot be null."); + } + defaultEndpointURL = new URL(endpointInfo.getAddress()); } return defaultEndpointURL; }