cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
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 GMT
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<String, Object>(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 {
+        
+    }
 }



Mime
View raw message