Author: ningjiang Date: Tue Dec 13 07:11:22 2011 New Revision: 1213579 URL: http://svn.apache.org/viewvc?rev=1213579&view=rev Log: Merged revisions 1213531 via svnmerge from https://svn.apache.org/repos/asf/camel/branches/camel-2.8.x
................ r1213531 | ningjiang | 2011-12-13 09:11:54 +0800 (Tue, 13 Dec 2011) | 13 lines Merged revisions 1213219,1213526 via svnmerge from https://svn.apache.org/repos/asf/camel/trunk ........ r1213219 | ningjiang | 2011-12-12 20:56:31 +0800 (Mon, 12 Dec 2011) | 1 line CAMEL-4768 Fix the issue that camel-http4 component send the endpoint parameters ........ r1213526 | ningjiang | 2011-12-13 08:58:49 +0800 (Tue, 13 Dec 2011) | 1 line CAMEL-4768 fix a CS error ........ ................ Modified: camel/branches/camel-2.7.x/ (props changed) camel/branches/camel-2.7.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpComponent.java camel/branches/camel-2.7.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEndpoint.java Propchange: camel/branches/camel-2.7.x/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue Dec 13 07:11:22 2011 @@ -1,2 +1,2 @@ -/camel/branches/camel-2.8.x:1170965,1171400,1174571,1175323,1176329,1176787,1177397,1177946,1177949,1180598,1187226,1189704,1199138,1199732,1199766,1199807,1200867,1201638-1201639,1202171,1202222,1202662,1204355,1205709,1208933,1210779,1210916,1211366,1211774,1211814,1213201 -/camel/trunk:1146608,1146903,1147216,1170956,1171396,1174565,1175321,1176274,1176781-1176782,1177394,1177945,1177948,1180597,1187221,1189693,1199137,1199703,1199739,1199804,1200861,1201623,1201637,1202167,1202215,1202659,1204338,1205412,1208930,1210771,1210830,1211363,1211773,1211811,1213197 +/camel/branches/camel-2.8.x:1170965,1171400,1174571,1175323,1176329,1176787,1177397,1177946,1177949,1180598,1187226,1189704,1199138,1199732,1199766,1199807,1200867,1201638-1201639,1202171,1202222,1202662,1204355,1205709,1208933,1210779,1210916,1211366,1211774,1211814,1213201,1213531 +/camel/trunk:1146608,1146903,1147216,1170956,1171396,1174565,1175321,1176274,1176781-1176782,1177394,1177945,1177948,1180597,1187221,1189693,1199137,1199703,1199739,1199804,1200861,1201623,1201637,1202167,1202215,1202659,1204338,1205412,1208930,1210771,1210830,1211363,1211773,1211811,1213197,1213219,1213526 Propchange: camel/branches/camel-2.7.x/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: camel/branches/camel-2.7.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpComponent.java URL: http://svn.apache.org/viewvc/camel/branches/camel-2.7.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpComponent.java?rev=1213579&r1=1213578&r2=1213579&view=diff ============================================================================== --- camel/branches/camel-2.7.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpComponent.java (original) +++ camel/branches/camel-2.7.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpComponent.java Tue Dec 13 07:11:22 2011 @@ -176,7 +176,10 @@ public class HttpComponent extends Heade // create the configurer to use for this endpoint HttpClientConfigurer configurer = createHttpClientConfigurer(parameters); URI endpointUri = URISupport.createRemainingURI(new URI(addressUri), CastUtils.cast(httpClientParameters)); - // restructure uri to be based on the parameters left as we dont want to include the Camel internal options + // create the endpoint and set the http uri to be null + HttpEndpoint endpoint = new HttpEndpoint(endpointUri.toString(), this, clientParams, clientConnectionManager, configurer); + // configure the endpoint + setProperties(endpoint, parameters); // The httpUri should be start with http or https String httpUriAddress = addressUri; if (addressUri.startsWith("http4")) { @@ -185,6 +188,8 @@ public class HttpComponent extends Heade if (addressUri.startsWith("https4")) { httpUriAddress = "https" + addressUri.substring(6); } + // restructure uri to be based on the parameters left as we dont want to include the Camel internal options + // build up the http uri URI httpUri = URISupport.createRemainingURI(new URI(httpUriAddress), CastUtils.cast(parameters)); // validate http uri that end-user did not duplicate the http part that can be a common error @@ -196,15 +201,7 @@ public class HttpComponent extends Heade "The uri part is not configured correctly. You have duplicated the http(s) protocol."); } } - - // register port on schema registry - boolean secure = isSecureConnection(uri); - int port = getPort(httpUri); - registerPort(secure, x509HostnameVerifier, port); - - // create the endpoint - HttpEndpoint endpoint = new HttpEndpoint(endpointUri.toString(), this, httpUri, clientParams, clientConnectionManager, configurer); - setProperties(endpoint, parameters); + endpoint.setHttpUri(httpUri); setEndpointHeaderFilterStrategy(endpoint); endpoint.setBinding(getHttpBinding()); if (httpBinding != null) { @@ -213,10 +210,14 @@ public class HttpComponent extends Heade if (httpClientConfigurer != null) { endpoint.setHttpClientConfigurer(httpClientConfigurer); } + // register port on schema registry + boolean secure = isSecureConnection(uri); + int port = getPort(httpUri); + registerPort(secure, x509HostnameVerifier, port); return endpoint; } - + private static int getPort(URI uri) { int port = uri.getPort(); if (port < 0) { Modified: camel/branches/camel-2.7.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEndpoint.java URL: http://svn.apache.org/viewvc/camel/branches/camel-2.7.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEndpoint.java?rev=1213579&r1=1213578&r2=1213579&view=diff ============================================================================== --- camel/branches/camel-2.7.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEndpoint.java (original) +++ camel/branches/camel-2.7.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEndpoint.java Tue Dec 13 07:11:22 2011 @@ -68,6 +68,11 @@ public class HttpEndpoint extends Defaul public HttpEndpoint(String endPointURI, HttpComponent component, URI httpURI, ClientConnectionManager clientConnectionManager) throws URISyntaxException { this(endPointURI, component, httpURI, new BasicHttpParams(), clientConnectionManager, null); } + + public HttpEndpoint(String endPointURI, HttpComponent component, HttpParams clientParams, + ClientConnectionManager clientConnectionManager, HttpClientConfigurer clientConfigurer) throws URISyntaxException { + this(endPointURI, component, null, clientParams, clientConnectionManager, clientConfigurer); + } public HttpEndpoint(String endPointURI, HttpComponent component, URI httpURI, HttpParams clientParams, ClientConnectionManager clientConnectionManager, HttpClientConfigurer clientConfigurer) throws URISyntaxException {