cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r597328 - in /incubator/cxf/trunk/rt/transports/http-jetty/src: main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineTest.java
Date Thu, 22 Nov 2007 08:05:44 GMT
Author: ningjiang
Date: Thu Nov 22 00:05:43 2007
New Revision: 597328

URL: http://svn.apache.org/viewvc?rev=597328&view=rev
Log:
Added setTLSServerParametersForPort back in JettyHTTPServerEngineFactory

Modified:
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineTest.java

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java?rev=597328&r1=597327&r2=597328&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java
(original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java
Thu Nov 22 00:05:43 2007
@@ -138,6 +138,35 @@
     public Map<String, ThreadingParameters> getThreadingParametersMap() {
         return threadingParametersMap;
     }
+    
+    /**
+     * This call sets TLSServerParameters for a JettyHTTPServerEngine
+     * that will be subsequently created. It will not alter an engine
+     * that has already been created for that network port.
+     * @param port       The network port number to bind to the engine.
+     * @param tlsParams  The tls server parameters. Cannot be null.
+     * @throws IOException 
+     * @throws GeneralSecurityException 
+     */
+    public void setTLSServerParametersForPort(
+        int port, 
+        TLSServerParameters tlsParams) throws GeneralSecurityException, IOException {
+        if (tlsParams == null) {
+            throw new IllegalArgumentException("tlsParams cannot be null");
+        }
+        JettyHTTPServerEngine ref = retrieveJettyHTTPServerEngine(port);
+        if (null == ref) {
+            ref = new JettyHTTPServerEngine(this, bus, port);
+            ref.setTlsServerParameters(tlsParams);
+            portMap.put(port, ref);
+            ref.finalizeConfig();
+        } else {
+            if (ref.getConnector() != null && ref.getConnector().isRunning()) {
+                throw new IOException("can't set the TLS params on the opened connector");
+            }
+            ref.setTlsServerParameters(tlsParams);            
+        }
+    }
             
     
     /**

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineTest.java?rev=597328&r1=597327&r2=597328&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineTest.java
(original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineTest.java
Thu Nov 22 00:05:43 2007
@@ -99,6 +99,10 @@
         assertTrue("Protocol must be https", 
                 "https".equals(engine.getProtocol()));
         
+        factory.setTLSServerParametersForPort(9234, new TLSServerParameters());
+        engine = factory.createJettyHTTPServerEngine(9234, "https");
+        assertTrue("Protocol must be https", 
+                   "https".equals(engine.getProtocol()));
         
         factory.destroyForPort(9234);
         factory.destroyForPort(9235);



Mime
View raw message