Author: ningjiang
Date: Thu Nov 22 05:30:52 2007
New Revision: 597408
URL: http://svn.apache.org/viewvc?rev=597408&view=rev
Log:
Merged revisions 597289-597313,597315-597329 via svnmerge from
https://svn.apache.org/repos/asf/incubator/cxf/trunk
........
r597289 | ningjiang | 2007-11-22 11:32:59 +0800 (Thu, 22 Nov 2007) | 1 line
Changed the JettyHTTPServerEngine's finalizeConfig to be public scope to
support configuring the engine in a programmable way
........
r597308 | ningjiang | 2007-11-22 14:13:32 +0800 (Thu, 22 Nov 2007) | 1 line
CXF1217 Added Gary's test case into the systest
........
r597328 | ningjiang | 2007-11-22 16:05:43 +0800 (Thu, 22 Nov 2007) | 1 line
Added setTLSServerParametersForPort back in JettyHTTPServerEngineFactory
........
r597329 | ningjiang | 2007-11-22 16:09:40 +0800 (Thu, 22 Nov 2007) | 1 line
Added more test for the setTLSServerParametersForPort
........
Added:
incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/bus/BusShutdownTest.java
- copied unchanged from r597308,
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/bus/BusShutdownTest.java
Modified:
incubator/cxf/branches/2.0.x-fixes/ (props changed)
incubator/cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
incubator/cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java
incubator/cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineTest.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/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java?rev=597408&r1=597407&r2=597408&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
Thu Nov 22 05:30:52 2007
@@ -513,7 +513,7 @@
* This method is called after configure on this object.
*/
@PostConstruct
- protected void finalizeConfig()
+ public void finalizeConfig()
throws GeneralSecurityException,
IOException {
retrieveEngineFactory();
Modified:
incubator/cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java?rev=597408&r1=597407&r2=597408&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java
Thu Nov 22 05:30:52 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/branches/2.0.x-fixes/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineTest.java?rev=597408&r1=597407&r2=597408&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineTest.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineTest.java
Thu Nov 22 05:30:52 2007
@@ -99,9 +99,19 @@
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.setTLSServerParametersForPort(9236, new TLSServerParameters());
+ engine = factory.createJettyHTTPServerEngine(9236, "https");
+ assertTrue("Protocol must be https",
+ "https".equals(engine.getProtocol()));
factory.destroyForPort(9234);
factory.destroyForPort(9235);
+ factory.destroyForPort(9236);
}