Return-Path: Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: (qmail 24364 invoked from network); 30 Jul 2010 01:27:21 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 30 Jul 2010 01:27:21 -0000 Received: (qmail 99817 invoked by uid 500); 30 Jul 2010 01:27:21 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 99755 invoked by uid 500); 30 Jul 2010 01:27:20 -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 99748 invoked by uid 99); 30 Jul 2010 01:27:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Jul 2010 01:27:20 +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; Fri, 30 Jul 2010 01:27:19 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 7DC2823889DD; Fri, 30 Jul 2010 01:26:03 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r980631 - in /cxf/trunk: rt/core/src/main/java/org/apache/cxf/service/factory/ systests/uncategorized/src/test/java/org/apache/cxf/systest/outofband/header/ Date: Fri, 30 Jul 2010 01:26:03 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100730012603.7DC2823889DD@eris.apache.org> Author: dkulp Date: Fri Jul 30 01:26:02 2010 New Revision: 980631 URL: http://svn.apache.org/viewvc?rev=980631&view=rev Log: Hook up EndpointProperty annotation Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AnnotationsFactoryBeanListener.java cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/outofband/header/OOBHeaderTest.java cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/outofband/header/Server.java Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AnnotationsFactoryBeanListener.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AnnotationsFactoryBeanListener.java?rev=980631&r1=980630&r2=980631&view=diff ============================================================================== --- cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AnnotationsFactoryBeanListener.java (original) +++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AnnotationsFactoryBeanListener.java Fri Jul 30 01:26:02 2010 @@ -25,6 +25,8 @@ import java.util.List; import org.apache.cxf.Bus; import org.apache.cxf.annotations.DataBinding; +import org.apache.cxf.annotations.EndpointProperties; +import org.apache.cxf.annotations.EndpointProperty; import org.apache.cxf.annotations.FastInfoset; import org.apache.cxf.annotations.GZIP; import org.apache.cxf.annotations.Logging; @@ -83,6 +85,11 @@ public class AnnotationsFactoryBeanListe addFastInfosetSupport(ep, cls.getAnnotation(FastInfoset.class)); addGZipSupport(ep, bus, cls.getAnnotation(GZIP.class)); addLoggingSupport(ep, bus, cls.getAnnotation(Logging.class)); + addEndpointProperties(ep, bus, cls.getAnnotation(EndpointProperty.class)); + EndpointProperties props = cls.getAnnotation(EndpointProperties.class); + if (props != null) { + addEndpointProperties(ep, bus, props.value()); + } break; } case SERVER_CREATED: { @@ -111,6 +118,11 @@ public class AnnotationsFactoryBeanListe WSDLDocumentation.Placement.SERVICE, docs.toArray(new WSDLDocumentation[docs.size()])); } + addEndpointProperties(server.getEndpoint(), bus, cls.getAnnotation(EndpointProperty.class)); + EndpointProperties props = cls.getAnnotation(EndpointProperties.class); + if (props != null) { + addEndpointProperties(server.getEndpoint(), bus, props.value()); + } addBindingOperationDocs(server); break; } @@ -132,6 +144,21 @@ public class AnnotationsFactoryBeanListe } } + private void addEndpointProperties(Endpoint ep, Bus bus, EndpointProperty ... annotations) { + for (EndpointProperty prop : annotations) { + if (prop == null) { + continue; + } + String s[] = prop.value(); + if (s.length == 1) { + ep.getEndpointInfo().setProperty(prop.key(), s[0]); + } else { + ep.getEndpointInfo().setProperty(prop.key(), s[1]); + } + } + + } + private void setDataBinding(AbstractServiceFactoryBean factory, DataBinding annotation) { if (annotation != null && factory.getDataBinding(false) == null) { Modified: cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/outofband/header/OOBHeaderTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/outofband/header/OOBHeaderTest.java?rev=980631&r1=980630&r2=980631&view=diff ============================================================================== --- cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/outofband/header/OOBHeaderTest.java (original) +++ cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/outofband/header/OOBHeaderTest.java Fri Jul 30 01:26:02 2010 @@ -187,18 +187,22 @@ public class OOBHeaderTest extends Abstr assertFalse(check(0, putLastTradedPrice, false, true, priceData)); assertFalse(check(1, putLastTradedPrice, false, true, priceData)); assertTrue(check(2, putLastTradedPrice, false, true, priceData)); + assertTrue(check(3, putLastTradedPrice, false, true, priceData)); assertFalse(check(0, putLastTradedPrice, true, true, priceData)); assertFalse(check(1, putLastTradedPrice, true, true, priceData)); assertFalse(check(2, putLastTradedPrice, true, true, priceData)); + assertFalse(check(3, putLastTradedPrice, true, true, priceData)); assertTrue(check(0, putLastTradedPrice, false, false, priceData)); assertTrue(check(1, putLastTradedPrice, false, false, priceData)); assertTrue(check(2, putLastTradedPrice, false, false, priceData)); + assertTrue(check(4, putLastTradedPrice, false, false, priceData)); assertTrue(check(0, putLastTradedPrice, true, false, priceData)); assertTrue(check(1, putLastTradedPrice, true, false, priceData)); assertTrue(check(2, putLastTradedPrice, true, false, priceData)); + assertTrue(check(4, putLastTradedPrice, true, false, priceData)); } private boolean check(int i, PutLastTradedPricePortType putLastTradedPrice, @@ -212,8 +216,12 @@ public class OOBHeaderTest extends Abstr case 1: address = "http://localhost:" + PORT + "/SOAPDocLitBareService/SoapPortNoHeader"; break; + case 2: + address = "http://localhost:" + PORT + "/SOAPDocLitBareService/SoapPortHeader"; + break; default: - address = "http://localhost:" + PORT + "/SOAPDocLitBareService/SoapPortHeader"; + address = "http://localhost:" + PORT + + "/SOAPDocLitBareService/SoapPortHeaderProperty"; } ((BindingProvider)putLastTradedPrice).getRequestContext() .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, address); Modified: cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/outofband/header/Server.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/outofband/header/Server.java?rev=980631&r1=980630&r2=980631&view=diff ============================================================================== --- cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/outofband/header/Server.java (original) +++ cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/outofband/header/Server.java Fri Jul 30 01:26:02 2010 @@ -24,12 +24,14 @@ package org.apache.cxf.systest.outofband import java.util.HashMap; import java.util.Map; +import javax.jws.WebService; import javax.xml.namespace.QName; import javax.xml.ws.Endpoint; import org.apache.cxf.Bus; //import org.apache.cxf.BusFactory; //import org.apache.cxf.bus.spring.SpringBusFactory; +import org.apache.cxf.annotations.EndpointProperty; import org.apache.cxf.testutil.common.AbstractBusTestServerBase; public class Server extends AbstractBusTestServerBase { @@ -76,6 +78,14 @@ public class Server extends AbstractBusT ep.setProperties(props); ep.publish("http://localhost:" + PORT + "/SOAPDocLitBareService/SoapPortHeader"); + ep = Endpoint.create(new OOBHdrPropertyServiceImpl()); + props = new HashMap(2); + props.put(Endpoint.WSDL_SERVICE, new QName("http://apache.org/hello_world_doc_lit_bare", + "SOAPService")); + props.put(Endpoint.WSDL_PORT, new QName("http://apache.org/hello_world_doc_lit_bare", "SoapPort")); + ep.setProperties(props); + ep.publish("http://localhost:" + PORT + "/SOAPDocLitBareService/SoapPortHeaderProperty"); + } @@ -90,4 +100,16 @@ public class Server extends AbstractBusT System.out.println("done!"); } } + + + @WebService(serviceName = "SOAPService", + portName = "SoapPort", + endpointInterface = "org.apache.hello_world_doc_lit_bare.PutLastTradedPricePortType", + targetNamespace = "http://apache.org/hello_world_doc_lit_bare", + wsdlLocation = "testutils/doc_lit_bare.wsdl") + @EndpointProperty(key = "endpoint-processes-headers", + value = "{http://cxf.apache.org/outofband/Header}outofbandHeader") + public class OOBHdrPropertyServiceImpl extends OOBHdrServiceImpl { + + } }