cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andreasm...@apache.org
Subject svn commit: r544131 - in /incubator/cxf/trunk/rt/transports: http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/ http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/ http-jetty/src/test/java/org/apache/cxf/transport/http_jetty...
Date Mon, 04 Jun 2007 11:51:00 GMT
Author: andreasmyth
Date: Mon Jun  4 04:50:59 2007
New Revision: 544131

URL: http://svn.apache.org/viewvc?view=rev&rev=544131
Log:
[JIRA CXF-674] for listener in http://cxf.apache.org/transport/http/listener namespace: bean
type extends beans:identifiedType. Like conduit and destination, listener implementation does
not extend JAXB generated class any more.

Added:
    incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/listener.xml
  (with props)
Modified:
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/ListenerBeanDefinitionParser.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/ApplicationContextTest.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/BeanDefinitionParsersTest.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/beans.xml
    incubator/cxf/trunk/rt/transports/http/pom.xml
    incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/spring.schemas
    incubator/cxf/trunk/rt/transports/http/src/main/resources/schemas/configuration/http-listener.xsd

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java?view=diff&rev=544131&r1=544130&r2=544131
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java
(original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java
Mon Jun  4 04:50:59 2007
@@ -327,5 +327,9 @@
         
         super.shutdown();
     }
+    
+    public ServerEngine getEngine() {
+        return engine;
+    }
    
 }

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java?view=diff&rev=544131&r1=544130&r2=544131
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
(original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
Mon Jun  4 04:50:59 2007
@@ -27,8 +27,8 @@
 import org.apache.cxf.configuration.jsse.TLSServerParameters;
 import org.apache.cxf.configuration.jsse.spring.TLSServerParametersConfig;
 import org.apache.cxf.configuration.security.SSLServerPolicy;
+import org.apache.cxf.configuration.security.TLSServerParametersType;
 import org.apache.cxf.transport.HttpUriMapper;
-import org.apache.cxf.transport.http.listener.HTTPListenerConfigBean;
 import org.apache.cxf.transports.http.configuration.HTTPListenerPolicy;
 import org.mortbay.jetty.AbstractConnector;
 import org.mortbay.jetty.Handler;
@@ -40,7 +40,6 @@
 
 
 public class JettyHTTPServerEngine
-    extends HTTPListenerConfigBean 
     implements ServerEngine {
     private static final long serialVersionUID = 1L;
    
@@ -50,6 +49,10 @@
     private JettyConnectorFactory connectorFactory;
     private ContextHandlerCollection contexts;
     
+    private HTTPListenerPolicy listener;
+    private SSLServerPolicy sslServer;
+    private TLSServerParametersType tlsServerParameters;
+    
     /**
      * This field holds the protocol this engine is for. "http" or "https".
      */
@@ -333,9 +336,8 @@
     }
     
     @Deprecated
-    @Override
     public void setSslServer(SSLServerPolicy policy) {
-        super.setSslServer(policy);
+        this.sslServer = policy;
         if (this.configFinalized) {
             this.retrieveListenerFactory();
         }
@@ -446,6 +448,59 @@
      */
     public TLSServerParameters getProgrammaticTlsServerParameters() {
         return tlsProgrammaticServerParameters;
+    } 
+
+    /**
+     * Returns the listener policy
+     *  @return the listener policy.
+     */
+    public HTTPListenerPolicy getListener() {
+        return listener;
     }
+
+    /**
+     * Sets the listener policy.
+     * @param listener The listener policy to set.
+     */
+    public void setListener(HTTPListenerPolicy listener) {
+        this.listener = listener;
+    }
+
+    /** 
+     * Returns the tlsServerParameters.
+     * @return the tlsServerParameters.
+     */
+    public TLSServerParametersType getTlsServerParameters() {
+        return tlsServerParameters;
+    }
+
+    /**
+     * Sets the tlsServerParameters.
+     * @param tlsServerParameters The tlsServerParameters to set.
+     */
+    public void setTlsServerParameters(TLSServerParametersType tlsServerParameters) {
+        this.tlsServerParameters = tlsServerParameters;
+    }
+
+    /** 
+     * Returns the sslServer policy.
+     * @return the sslServer policy.
+     */
+    public SSLServerPolicy getSslServer() {
+        return sslServer;
+    }
+    
+    public boolean isSetListener() {
+        return null != listener;
+    }
+    
+    public boolean isSetSslServer() {
+        return null != sslServer;
+    }
+    
+    public boolean isSetTlsServerParameters() {
+        return null != tlsServerParameters; 
+    }
+    
     
 }

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/ListenerBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/ListenerBeanDefinitionParser.java?view=diff&rev=544131&r1=544130&r2=544131
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/ListenerBeanDefinitionParser.java
(original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/ListenerBeanDefinitionParser.java
Mon Jun  4 04:50:59 2007
@@ -21,14 +21,17 @@
 import javax.xml.namespace.QName;
 
 import org.w3c.dom.Element;
+
+import org.apache.cxf.configuration.security.SSLServerPolicy;
+import org.apache.cxf.configuration.security.TLSServerParametersType;
 import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
 import org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine;
-
+import org.apache.cxf.transports.http.configuration.HTTPListenerPolicy;
 import org.springframework.beans.factory.support.BeanDefinitionBuilder;
 
 public class ListenerBeanDefinitionParser  extends AbstractBeanDefinitionParser {
      
-    private static final String HTTP_NS = "http://cxf.apache.org/transports/http/configuration";
+    private static final String LISTENER_NS = "http://cxf.apache.org/transport/http/listener";
     
     @Override
     protected Class getBeanClass(Element arg0) {
@@ -38,11 +41,21 @@
     @Override
     public void doParse(Element element, BeanDefinitionBuilder bean) {
         bean.setAbstract(true);
-        mapElementToJaxbProperty(element, bean, new QName(HTTP_NS, "listener"), "listener");
+        mapElementToJaxbProperty(element, bean, new QName(LISTENER_NS, "listener"), "listener",
+            HTTPListenerPolicy.class, HTTPListenerPolicy.class.getPackage().getName());
+        // TODO: what about the other two properties?
+
+        mapElementToJaxbProperty(element, bean, new QName(LISTENER_NS, "sslServer"), "sslServer",
+            SSLServerPolicy.class, SSLServerPolicy.class.getPackage().getName());
+        mapElementToJaxbProperty(element, bean, new QName(LISTENER_NS, "tlsServerParameters"),

+            "tlsServerParameters",
+            TLSServerParametersType.class, TLSServerParametersType.class.getPackage().getName());
+
     }
 
     @Override
     protected String getJaxbPackage() {
-        return "org.apache.cxf.transports.http.configuration";
+        // not needed - return null?
+        return "org.apache.cxf.transport.http.listener";
     }
 }

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/ApplicationContextTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/ApplicationContextTest.java?view=diff&rev=544131&r1=544130&r2=544131
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/ApplicationContextTest.java
(original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/ApplicationContextTest.java
Mon Jun  4 04:50:59 2007
@@ -34,6 +34,7 @@
 import org.apache.cxf.transport.DestinationFactoryManager;
 import org.apache.cxf.transport.http.HTTPConduit;
 import org.apache.cxf.transport.http_jetty.JettyHTTPDestination;
+import org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine;
 import org.junit.Assert;
 import org.junit.Ignore;
 import org.junit.Test;
@@ -89,7 +90,10 @@
             dfm.getDestinationFactory("http://schemas.xmlsoap.org/soap/http").getDestination(info);
         assertTrue(d instanceof JettyHTTPDestination);
         JettyHTTPDestination jd = (JettyHTTPDestination) d;        
-        assertEquals("foobar", jd.getServer().getContentEncoding());
+        assertEquals("foobar", jd.getServer().getContentEncoding());   
+        
+        JettyHTTPServerEngine engine = (JettyHTTPServerEngine)jd.getEngine();
+        assertEquals(111, engine.getListener().getMinThreads());
         
         ConduitInitiatorManager cim = bus.getExtension(ConduitInitiatorManager.class);
         ConduitInitiator ci = cim.getConduitInitiator("http://schemas.xmlsoap.org/soap/http");

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/BeanDefinitionParsersTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/BeanDefinitionParsersTest.java?view=diff&rev=544131&r1=544130&r2=544131
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/BeanDefinitionParsersTest.java
(original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/BeanDefinitionParsersTest.java
Mon Jun  4 04:50:59 2007
@@ -24,6 +24,7 @@
 import org.apache.cxf.transport.http.spring.HttpConduitBeanDefinitionParser;
 import org.apache.cxf.transport.http.spring.HttpDestinationBeanDefinitionParser;
 import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
+import org.apache.cxf.transports.http.configuration.HTTPListenerPolicy;
 import org.apache.cxf.transports.http.configuration.HTTPServerPolicy;
 import org.junit.Assert;
 import org.junit.Test;
@@ -58,5 +59,19 @@
         PropertyValue[] pvs = bd.getRawBeanDefinition().getPropertyValues().getPropertyValues();
         assertEquals(1, pvs.length);
         assertEquals(97, ((HTTPClientPolicy) pvs[0].getValue()).getConnectionTimeout(), 0);
+    }
+    
+    @Test
+    public void testHttpListener()throws Exception {
+        BeanDefinitionBuilder bd = BeanDefinitionBuilder.childBeanDefinition("child");
+        
+        ListenerBeanDefinitionParser parser = new ListenerBeanDefinitionParser();
+
+        Document d = DOMUtils.readXml(getClass().getResourceAsStream("listener.xml"));
+        parser.doParse(d.getDocumentElement(), bd);
+        
+        PropertyValue[] pvs = bd.getRawBeanDefinition().getPropertyValues().getPropertyValues();
+        assertEquals(1, pvs.length);
+        assertEquals(111, ((HTTPListenerPolicy) pvs[0].getValue()).getMinThreads());
     }
 }

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/beans.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/beans.xml?view=diff&rev=544131&r1=544130&r2=544131
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/beans.xml
(original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/beans.xml
Mon Jun  4 04:50:59 2007
@@ -21,10 +21,12 @@
        xmlns:beans="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:h="http://cxf.apache.org/transports/http/configuration"
+       xmlns:l="http://cxf.apache.org/transport/http/listener"
        xmlns:sec="http://cxf.apache.org/configuration/security"
        xsi:schemaLocation="
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
 http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd
+http://cxf.apache.org/transport/http/listener http://cxf.apache.org/schemas/configuration/http-listener.xsd
 http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd"
 >
 
@@ -39,5 +41,15 @@
     <h:conduit name="*Bar.http-conduit">
       <h:client ConnectionTimeout="79"/>
     </h:conduit>
+    
+    <l:listener id="org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.9000">
    
+      <l:listener>
+        <h:MinThreads>111</h:MinThreads> 
+      </l:listener> 
+      <l:sslServer>
+        <sec:WantClientAuthentication>true</sec:WantClientAuthentication>
+      </l:sslServer>
+    </l:listener>
+    
 
 </beans>

Added: incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/listener.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/listener.xml?view=auto&rev=544131
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/listener.xml
(added)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/listener.xml
Mon Jun  4 04:50:59 2007
@@ -0,0 +1,5 @@
+<l:listener xmlns:l="http://cxf.apache.org/transport/http/listener" xmlns:h="http://cxf.apache.org/transports/http/configuration">
+  <l:listener>
+    <h:MinThreads>111</h:MinThreads> 
+  </l:listener>
+</l:listener>
\ No newline at end of file

Propchange: incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/listener.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/listener.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/listener.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: incubator/cxf/trunk/rt/transports/http/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/pom.xml?view=diff&rev=544131&r1=544130&r2=544131
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/pom.xml (original)
+++ incubator/cxf/trunk/rt/transports/http/pom.xml Mon Jun  4 04:50:59 2007
@@ -96,19 +96,6 @@
                                         <deleteDir>${basedir}/target/generated/src/main/java/org/apache/cxf/wsdl</deleteDir>
                                     </deleteDirs>
                                 </xsdOption>
-                                <xsdOption>
-                                    <xsd>${basedir}/src/main/resources/schemas/configuration/http-listener.xsd</xsd>
-                                    <bindingFile>${basedir}/src/main/resources/schemas/wsdl/http-conf.xjb</bindingFile>
-                                    <catalog>${basedir}/src/main/resources/catalog.cat</catalog>
-                                    <extension>true</extension>
-                                    <extensionArgs>
-                                        <extensionArg>-Xdv</extensionArg>
-                                    </extensionArgs>
-                                    <deleteDirs>
-                                        <deleteDir>${basedir}/target/generated/src/main/java/org/apache/cxf/wsdl</deleteDir>
-                                        <deleteDir>${basedir}/target/generated/src/main/java/org/apache/cxf/configuration/security</deleteDir>
-                                    </deleteDirs>
-                                </xsdOption>
                             </xsdOptions>
                         </configuration>
                         <goals>

Modified: incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/spring.schemas
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/spring.schemas?view=diff&rev=544131&r1=544130&r2=544131
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/spring.schemas (original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/spring.schemas Mon
Jun  4 04:50:59 2007
@@ -1,2 +1,3 @@
 http\://cxf.apache.org/schemas/wsdl/http-conf.xsd=schemas/wsdl/http-conf.xsd
 http\://cxf.apache.org/schemas/configuration/http-conf.xsd=schemas/configuration/http-conf.xsd
+http\://cxf.apache.org/schemas/configuration/http-listener.xsd=schemas/configuration/http-listener.xsd

Modified: incubator/cxf/trunk/rt/transports/http/src/main/resources/schemas/configuration/http-listener.xsd
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/resources/schemas/configuration/http-listener.xsd?view=diff&rev=544131&r1=544130&r2=544131
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/resources/schemas/configuration/http-listener.xsd
(original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/resources/schemas/configuration/http-listener.xsd
Mon Jun  4 04:50:59 2007
@@ -23,27 +23,38 @@
            xmlns:xs="http://www.w3.org/2001/XMLSchema" 
            xmlns:http-conf="http://cxf.apache.org/transports/http/configuration" 
            xmlns:sec="http://cxf.apache.org/configuration/security" 
-           xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
+           xmlns:beans="http://www.springframework.org/schema/beans" 
+           xmlns:cxf-beans="http://cxf.apache.org/configuration/beans"
            elementFormDefault="qualified" 
            attributeFormDefault="unqualified"
-           jaxb:version="2.0">
+           xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
+           jaxb:ersion="2.0">
 
     <xs:import namespace="http://cxf.apache.org/configuration/security" schemaLocation="http://cxf.apache.org/schemas/configuration/security.xsd"/>
     <xs:import namespace="http://cxf.apache.org/transports/http/configuration" schemaLocation="http://cxf.apache.org/schemas/wsdl/http-conf.xsd"/>
+    <xs:import namespace="http://www.springframework.org/schema/beans" schemaLocation="http://www.springframework.org/schema/beans/spring-beans.xsd"/>
+    <xs:import namespace="http://cxf.apache.org/configuration/beans" schemaLocation="http://cxf.apache.org/schemas/configuration/cxf-beans.xsd"/>
 
+    <!--
     <xs:element name="listener" type="http-conf:HTTPListenerPolicy"/>
     <xs:element name="sslServer" type="sec:SSLServerPolicy"/>
     <xs:element name="tlsServerParameters" type="sec:TLSServerParametersType"/>
+    -->
 
-    <xs:complexType name="HTTPListenerConfigBean">
-        <xs:sequence>
-            <xs:element ref="tns:listener" minOccurs="0"/>
-            
-            <!-- The following element in deprecated in favor of tlsServerParameters -->
-            <xs:element ref="tns:sslServer" minOccurs="0"/>
-            
-            <xs:element ref="tns:tlsServerParameters" minOccurs="0"/>
-        </xs:sequence>
-    </xs:complexType>
+    <xs:element name="listener">
+        <xs:complexType>
+            <xs:complexContent>
+                <xs:extension base="beans:identifiedType">
+                    <xs:sequence>
+                        <xs:element name="listener" type="http-conf:HTTPListenerPolicy"
minOccurs="0"/>
+                        <!-- The following element is deprecated in favor of tlsServerParameters
-->
+                        <xs:element name="sslServer" type="sec:SSLServerPolicy" minOccurs="0"/>
+                        <xs:element name="tlsServerParameters" type="sec:TLSServerParametersType"
minOccurs="0"/>
+                    </xs:sequence>
+                    <xs:attributeGroup ref="cxf-beans:beanAttributes"/>
+                </xs:extension>
+            </xs:complexContent>
+        </xs:complexType>
+    </xs:element>
 
  </xs:schema>



Mime
View raw message