You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by bu...@apache.org on 2016/11/22 15:47:42 UTC

svn commit: r1001490 - in /websites/production/cxf/content: cache/docs.pageCache docs/standalone-http-transport.html

Author: buildbot
Date: Tue Nov 22 15:47:42 2016
New Revision: 1001490

Log:
Production update by buildbot for cxf

Modified:
    websites/production/cxf/content/cache/docs.pageCache
    websites/production/cxf/content/docs/standalone-http-transport.html

Modified: websites/production/cxf/content/cache/docs.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/cxf/content/docs/standalone-http-transport.html
==============================================================================
--- websites/production/cxf/content/docs/standalone-http-transport.html (original)
+++ websites/production/cxf/content/docs/standalone-http-transport.html Tue Nov 22 15:47:42 2016
@@ -117,14 +117,8 @@ Apache CXF -- Standalone HTTP Transport
          <td height="100%">
            <!-- Content -->
            <div class="wiki-content">
-<div id="ConfluenceContent"><h1 id="StandaloneHTTPTransport-ConfiguringSSL">Configuring SSL</h1>
-
-<p>To configure the standalone HTTP transport to use SSL, you'll need to add an &lt;http:destination&gt; definition to your XML configuration file. See the <a shape="rect" href="configuration.html">Configuration</a> guide to learn how to supply your own XML configuration file to CXF. If you are already using Spring, this can be added to your existing beans definitions. For more information about configuring TLS, see the <a shape="rect" href="https://cwiki.apache.org/confluence/display/CXF20DOC/TLS+Configuration">Configuring TLS</a> page.</p>
-
-<p>Destinations in CXF are responsible for listening for server side requests.</p>
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">
-&lt;beans xmlns="http://www.springframework.org/schema/beans"
+<div id="ConfluenceContent"><h1 id="StandaloneHTTPTransport-ConfiguringSSL">Configuring SSL</h1><p>To configure the standalone HTTP transport to use SSL, you'll need to add an &lt;http:destination&gt; definition to your XML configuration file. See the <a shape="rect" href="configuration.html">Configuration</a> guide to learn how to supply your own XML configuration file to CXF. If you are already using Spring, this can be added to your existing beans definitions. For more information about configuring TLS, see the <a shape="rect" href="https://cwiki.apache.org/confluence/display/CXF20DOC/TLS+Configuration">Configuring TLS</a> page.</p><p>Destinations in CXF are responsible for listening for server side requests.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">&lt;beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:sec="http://cxf.apache.org/configuration/security"
   xmlns:http="http://cxf.apache.org/transports/http/configuration"
@@ -173,13 +167,8 @@ Apache CXF -- Standalone HTTP Transport
   &lt;/httpj:engine-factory&gt;
 &lt;/bean&gt; 
 </pre>
-</div></div>
-
-<h1 id="StandaloneHTTPTransport-Addthestaticcontentpagesintothejettyserver">Add the static content pages into the jetty server</h1>
-<p>The CXF standalone http transport is based on the jetty server. The code below shows how to get the jetty server from the destination and how to add the static content path to the jetty server.</p>
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
-    // get the jetty server form the destination
+</div></div><h1 id="StandaloneHTTPTransport-Addthestaticcontentpagesintothejettyserver">Add the static content pages into the jetty server</h1><p>The CXF standalone http transport is based on the jetty server. The code below shows how to get the jetty server from the destination and how to add the static content path to the jetty server.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">    // get the jetty server form the destination
     EndpointInfo ei = new EndpointInfo();
     ei.setAddress(serviceFactory.getAddress());
     Destination destination = df.getDestination(ei);
@@ -207,7 +196,7 @@ Apache CXF -- Standalone HTTP Transport
     FileResource fileResource = new FileResource(targetURL);
     resourceHandler.setBaseResource(fileResource);
 </pre>
-</div></div></div>
+</div></div><h1 id="StandaloneHTTPTransport-ConfiguringStandaloneJettyinOSGi">Configuring Standalone Jetty in OSGi</h1><p>An OSGi application can use the standalone transport by incorporating&#160;cxf-rt-transports-http-jetty, which is an OSGi bundle, and&#160;creating<br clear="none">services with endpoint URLs like <code>http://0.0.0.0:8181/rest/v1/entities</code>.&#160;<br clear="none"><br clear="none">If your application needs to configure Jetty, is has to communicate with CXF's mechanism for this purpose, which lives in <br clear="none"><code>org.apache.cxf.transport.http_jetty.osgi.HTTPJettyTransportActivator</code>.<br clear="none"><br clear="none">CXF allows an application to use different configuration parameters for different 'engines'. An engine is <br clear="none">specified by three properties:<br clear="none"><br clear="none"></p><ul><li>HTTP vs. HTTPS (protocol)</li><li>host</li><li>port</li></ul><p><br clear="none">For each endpoint, CXF allows you to specify:<br clea
 r="none"><br clear="none"></p><ul><li>sessionSupport</li><li>continuationsEnabled</li><li>reuseAddress</li><li>maxIdleTime</li><li>a giant, complex, raft of TLS parameters for HTTPS.</li></ul><p><br clear="none">Each of these engines is a shared resource, in that many endpoints can coexist on an engine. Thus, these shared<br clear="none">parameters can't be configured as part of launching an endpoint.<br clear="none"><br clear="none">Instead, CXF (in HTTPJettyTransportActivator), creates an OSGi <code>ManagedServiceFactory</code>. Usually, a managed service<br clear="none">factory is a creature that creates multiple OSGi services on demand, each with a particular configuration. <br clear="none">CXF doesn't really do that. Instead, each time that an application publishes a configuration, CXF sets the parameters<br clear="none">for the engine described by the configuration properties.<br clear="none"><br clear="none">Concretely, if an application calls the <code>createFactoryConfigura
 tion</code>&#160;method of the `ConfigurationAdmin` service for PID<br clear="none">`org.apache.cxf.http.jetty`, CXF looks in the properties. It expects to find `host` and `port`. If it finds<br clear="none">any TLS parameters, it configures for HTTPS. If not, it configures for HTTP. It then applies all the other parameters<br clear="none">to the engine for that [protocol,host,port] triple.</p><p>If your application needs to create such a configuration and then modify if (all before CXF actually starts up the engine), you must use code like:</p><pre><span style="color: rgb(128,128,128);">configurationAdmin.listConfigurations(String.format("(&amp;(service.factoryPid=%s)(%s=%s))", <br clear="none"></span><span style="color: rgb(128,128,128);"> parsed[0], ConfigurationFileReaderImpl.INSTANCE_ID, parsed[1]));</span></pre><p>&#160;</p><p>to locate the configuration you created before, where "ConfigurationFileReaderImpl.INSTANCE_ID" is just an example of how you would use a property of yo
 ur own choice to uniquely specify the configuration.</p><p>&#160;</p><p>&#160;</p></div>
            </div>
            <!-- Content -->
          </td>