Author: veithen
Date: Sun Jan 15 23:24:07 2017
New Revision: 1778956
URL: http://svn.apache.org/viewvc?rev=1778956&view=rev
Log:
Extract common code.
Added:
axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/RequestBase.java
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/RequestBase.java
Modified:
axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/DeleteRequest.java
axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/GetRequest.java
axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/PostRequest.java
axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/PutRequest.java
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/DeleteRequest.java
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/GetRequest.java
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/PostRequest.java
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/PutRequest.java
Modified:
axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/DeleteRequest.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/DeleteRequest.java?rev=1778956&r1=1778955&r2=1778956&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/DeleteRequest.java
(original)
+++
axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/DeleteRequest.java
Sun Jan 15 23:24:07 2017
@@ -23,33 +23,19 @@ import java.net.URL;
import org.apache.axis2.AxisFault;
import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.transport.http.Request;
-import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.DeleteMethod;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-class DeleteRequest implements Request {
+class DeleteRequest extends RequestBase<DeleteMethod> {
private static final Log log = LogFactory.getLog(DeleteRequest.class);
- private final HTTPSenderImpl sender;
- private final String soapActiionString;
- private final MessageContext msgContext;
- private final URL url;
-
- DeleteRequest(HTTPSenderImpl sender, String soapActiionString,
MessageContext msgContext, URL url) {
- this.sender = sender;
- this.soapActiionString = soapActiionString;
- this.msgContext = msgContext;
- this.url = url;
+ DeleteRequest(HTTPSenderImpl sender, String soapActionString,
MessageContext msgContext, URL url) throws AxisFault {
+ super(sender, soapActionString, msgContext, url, new DeleteMethod());
}
@Override
public void execute() throws AxisFault {
- DeleteMethod method = new DeleteMethod();
- HttpClient httpClient = sender.getHttpClient(msgContext);
- sender.populateCommonProperties(msgContext, url, method, httpClient,
soapActiionString);
-
try {
sender.executeMethod(httpClient, msgContext, url, method);
sender.handleResponse(msgContext, method);
Modified:
axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/GetRequest.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/GetRequest.java?rev=1778956&r1=1778955&r2=1778956&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/GetRequest.java
(original)
+++
axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/GetRequest.java
Sun Jan 15 23:24:07 2017
@@ -23,40 +23,24 @@ import java.net.URL;
import org.apache.axis2.AxisFault;
import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.transport.MessageFormatter;
import org.apache.axis2.transport.http.HTTPConstants;
-import org.apache.axis2.transport.http.Request;
-import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-class GetRequest implements Request {
+class GetRequest extends RequestBase<GetMethod> {
private static final Log log = LogFactory.getLog(GetRequest.class);
- private final HTTPSenderImpl sender;
- private final MessageContext msgContext;
- private final String soapActiionString;
- private final URL url;
-
- GetRequest(HTTPSenderImpl sender, MessageContext msgContext, String
soapActiionString, URL url) {
- this.sender = sender;
- this.msgContext = msgContext;
- this.soapActiionString = soapActiionString;
- this.url = url;
+ GetRequest(HTTPSenderImpl sender, MessageContext msgContext, String
soapActionString, URL url) throws AxisFault {
+ super(sender, soapActionString, msgContext, url, new GetMethod());
}
@Override
public void execute() throws AxisFault {
- GetMethod method = new GetMethod();
- HttpClient httpClient = sender.getHttpClient(msgContext);
- MessageFormatter messageFormatter =
sender.populateCommonProperties(msgContext, url, method,
- httpClient, soapActiionString);
-
// Need to have this here because we can have soap action when using
the
// soap response MEP
String soapAction = messageFormatter
- .formatSOAPAction(msgContext, sender.getFormat(),
soapActiionString);
+ .formatSOAPAction(msgContext, sender.getFormat(),
soapActionString);
if (soapAction != null && !msgContext.isDoingREST()) {
method.setRequestHeader(HTTPConstants.HEADER_SOAP_ACTION,
soapAction);
Modified:
axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/PostRequest.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/PostRequest.java?rev=1778956&r1=1778955&r2=1778956&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/PostRequest.java
(original)
+++
axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/PostRequest.java
Sun Jan 15 23:24:07 2017
@@ -23,39 +23,23 @@ import java.net.URL;
import org.apache.axis2.AxisFault;
import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.transport.MessageFormatter;
import org.apache.axis2.transport.http.HTTPConstants;
-import org.apache.axis2.transport.http.Request;
-import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-class PostRequest implements Request {
+class PostRequest extends RequestBase<PostMethod> {
private static final Log log = LogFactory.getLog(PostRequest.class);
- private final HTTPSenderImpl sender;
- private final URL url;
- private final MessageContext msgContext;
- private final String soapActionString;
-
- PostRequest(HTTPSenderImpl sender, URL url, MessageContext msgContext,
String soapActionString) {
- this.sender = sender;
- this.url = url;
- this.msgContext = msgContext;
- this.soapActionString = soapActionString;
+ PostRequest(HTTPSenderImpl sender, URL url, MessageContext msgContext,
String soapActionString) throws AxisFault {
+ super(sender, soapActionString, msgContext, url, new PostMethod());
}
@Override
public void execute() throws AxisFault {
- HttpClient httpClient = sender.getHttpClient(msgContext);
-
- PostMethod method = new PostMethod();
if (log.isTraceEnabled()) {
log.trace(Thread.currentThread() + " PostMethod " + method + " / "
+ httpClient);
}
- MessageFormatter messageFormatter =
sender.populateCommonProperties(msgContext, url, method,
- httpClient, soapActionString);
method.setRequestEntity(new AxisRequestEntityImpl(messageFormatter,
msgContext, sender.getFormat(),
soapActionString, sender.isChunked(),
sender.isAllowedRetry()));
Modified:
axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/PutRequest.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/PutRequest.java?rev=1778956&r1=1778955&r2=1778956&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/PutRequest.java
(original)
+++
axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/PutRequest.java
Sun Jan 15 23:24:07 2017
@@ -23,37 +23,20 @@ import java.net.URL;
import org.apache.axis2.AxisFault;
import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.transport.MessageFormatter;
import org.apache.axis2.transport.http.HTTPConstants;
-import org.apache.axis2.transport.http.Request;
-import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.PutMethod;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-class PutRequest implements Request {
+class PutRequest extends RequestBase<PutMethod> {
private static final Log log = LogFactory.getLog(PutRequest.class);
- private final HTTPSenderImpl sender;
- private final String soapActionString;
- private final MessageContext msgContext;
- private final URL url;
-
- PutRequest(HTTPSenderImpl sender, String soapActionString, MessageContext
msgContext, URL url) {
- this.sender = sender;
- this.soapActionString = soapActionString;
- this.msgContext = msgContext;
- this.url = url;
+ PutRequest(HTTPSenderImpl sender, String soapActionString, MessageContext
msgContext, URL url) throws AxisFault {
+ super(sender, soapActionString, msgContext, url, new PutMethod());
}
@Override
public void execute() throws AxisFault {
- HttpClient httpClient = sender.getHttpClient(msgContext);
-
- PutMethod method = new PutMethod();
- MessageFormatter messageFormatter =
sender.populateCommonProperties(msgContext, url, method,
- httpClient, soapActionString);
-
method.setRequestEntity(new AxisRequestEntityImpl(messageFormatter,
msgContext, sender.getFormat(),
soapActionString, sender.isChunked(),
sender.isAllowedRetry()));
Added:
axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/RequestBase.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/RequestBase.java?rev=1778956&view=auto
==============================================================================
---
axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/RequestBase.java
(added)
+++
axis/axis2/java/core/trunk/modules/transport/http-hc3/src/main/java/org/apache/axis2/transport/http/impl/httpclient3/RequestBase.java
Sun Jan 15 23:24:07 2017
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis2.transport.http.impl.httpclient3;
+
+import java.net.URL;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.transport.MessageFormatter;
+import org.apache.axis2.transport.http.Request;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpMethodBase;
+
+abstract class RequestBase<T extends HttpMethodBase> implements Request {
+ protected final HTTPSenderImpl sender;
+ protected final String soapActionString;
+ protected final MessageContext msgContext;
+ protected final URL url;
+ protected final T method;
+ protected final HttpClient httpClient;
+ protected final MessageFormatter messageFormatter;
+
+ RequestBase(HTTPSenderImpl sender, String soapActionString, MessageContext
msgContext, URL url, T method) throws AxisFault {
+ this.sender = sender;
+ this.soapActionString = soapActionString;
+ this.msgContext = msgContext;
+ this.url = url;
+ this.method = method;
+ httpClient = sender.getHttpClient(msgContext);
+ messageFormatter = sender.populateCommonProperties(msgContext, url,
method,
+ httpClient, soapActionString);
+ }
+}
Modified:
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/DeleteRequest.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/DeleteRequest.java?rev=1778956&r1=1778955&r2=1778956&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/DeleteRequest.java
(original)
+++
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/DeleteRequest.java
Sun Jan 15 23:24:07 2017
@@ -23,34 +23,20 @@ import java.net.URL;
import org.apache.axis2.AxisFault;
import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.transport.http.Request;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpDelete;
-import org.apache.http.impl.client.AbstractHttpClient;
-class DeleteRequest implements Request {
+class DeleteRequest extends RequestBase<HttpDelete> {
private static final Log log = LogFactory.getLog(DeleteRequest.class);
- private final HTTPSenderImpl sender;
- private final MessageContext msgContext;
- private final URL url;
- private final String soapActionString;
-
- DeleteRequest(HTTPSenderImpl sender, MessageContext msgContext, URL url,
String soapActionString) {
- this.sender = sender;
- this.msgContext = msgContext;
- this.url = url;
- this.soapActionString = soapActionString;
+ DeleteRequest(HTTPSenderImpl sender, MessageContext msgContext, URL url,
String soapActionString) throws AxisFault {
+ super(sender, soapActionString, msgContext, url, new HttpDelete());
}
@Override
public void execute() throws AxisFault {
- HttpDelete method = new HttpDelete();
- AbstractHttpClient httpClient = sender.getHttpClient(msgContext);
- sender.populateCommonProperties(msgContext, url, method, httpClient,
soapActionString);
-
/*
* main execution takes place..
*/
Modified:
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/GetRequest.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/GetRequest.java?rev=1778956&r1=1778955&r2=1778956&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/GetRequest.java
(original)
+++
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/GetRequest.java
Sun Jan 15 23:24:07 2017
@@ -23,37 +23,21 @@ import java.net.URL;
import org.apache.axis2.AxisFault;
import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.transport.MessageFormatter;
import org.apache.axis2.transport.http.HTTPConstants;
-import org.apache.axis2.transport.http.Request;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
-import org.apache.http.impl.client.AbstractHttpClient;
-class GetRequest implements Request {
+class GetRequest extends RequestBase<HttpGet> {
private static final Log log = LogFactory.getLog(GetRequest.class);
- private final HTTPSenderImpl sender;
- private final MessageContext msgContext;
- private final String soapActionString;
- private final URL url;
-
- GetRequest(HTTPSenderImpl sender, MessageContext msgContext, String
soapActionString, URL url) {
- this.sender = sender;
- this.msgContext = msgContext;
- this.soapActionString = soapActionString;
- this.url = url;
+ GetRequest(HTTPSenderImpl sender, MessageContext msgContext, String
soapActionString, URL url) throws AxisFault {
+ super(sender, soapActionString, msgContext, url, new HttpGet());
}
@Override
public void execute() throws AxisFault {
- HttpGet method = new HttpGet();
- AbstractHttpClient httpClient = sender.getHttpClient(msgContext);
- MessageFormatter messageFormatter =
sender.populateCommonProperties(msgContext, url, method,
-
httpClient, soapActionString);
-
// Need to have this here because we can have soap action when using
the
// soap response MEP
String soapAction = messageFormatter
Modified:
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/PostRequest.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/PostRequest.java?rev=1778956&r1=1778955&r2=1778956&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/PostRequest.java
(original)
+++
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/PostRequest.java
Sun Jan 15 23:24:07 2017
@@ -23,40 +23,24 @@ import java.net.URL;
import org.apache.axis2.AxisFault;
import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.transport.MessageFormatter;
import org.apache.axis2.transport.http.HTTPConstants;
-import org.apache.axis2.transport.http.Request;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpPost;
-import org.apache.http.impl.client.AbstractHttpClient;
-class PostRequest implements Request {
+class PostRequest extends RequestBase<HttpPost> {
private static final Log log = LogFactory.getLog(PostRequest.class);
- private final HTTPSenderImpl sender;
- private final MessageContext msgContext;
- private final URL url;
- private final String soapActionString;
-
- PostRequest(HTTPSenderImpl sender, MessageContext msgContext, URL url,
String soapActionString) {
- this.sender = sender;
- this.msgContext = msgContext;
- this.url = url;
- this.soapActionString = soapActionString;
+ PostRequest(HTTPSenderImpl sender, MessageContext msgContext, URL url,
String soapActionString) throws AxisFault {
+ super(sender, soapActionString, msgContext, url, new HttpPost());
}
@Override
public void execute() throws AxisFault {
- AbstractHttpClient httpClient = sender.getHttpClient(msgContext);
-
- HttpPost method = new HttpPost();
if (log.isTraceEnabled()) {
log.trace(Thread.currentThread() + " PostMethod " + method + " / "
+ httpClient);
}
- MessageFormatter messageFormatter =
sender.populateCommonProperties(msgContext, url, method,
-
httpClient, soapActionString);
AxisRequestEntityImpl requestEntity =
new AxisRequestEntityImpl(messageFormatter, msgContext,
sender.getFormat(),
soapActionString,
sender.isChunked(), sender.isAllowedRetry());
Modified:
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/PutRequest.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/PutRequest.java?rev=1778956&r1=1778955&r2=1778956&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/PutRequest.java
(original)
+++
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/PutRequest.java
Sun Jan 15 23:24:07 2017
@@ -23,37 +23,21 @@ import java.net.URL;
import org.apache.axis2.AxisFault;
import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.transport.MessageFormatter;
import org.apache.axis2.transport.http.HTTPConstants;
-import org.apache.axis2.transport.http.Request;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpPut;
-import org.apache.http.impl.client.AbstractHttpClient;
-class PutRequest implements Request {
+class PutRequest extends RequestBase<HttpPut> {
private static final Log log = LogFactory.getLog(PutRequest.class);
- private final HTTPSenderImpl sender;
- private final URL url;
- private final String soapActionString;
- private final MessageContext msgContext;
-
- PutRequest(HTTPSenderImpl sender, URL url, String soapActionString,
MessageContext msgContext) {
- this.sender = sender;
- this.url = url;
- this.soapActionString = soapActionString;
- this.msgContext = msgContext;
+ PutRequest(HTTPSenderImpl sender, URL url, String soapActionString,
MessageContext msgContext) throws AxisFault {
+ super(sender, soapActionString, msgContext, url, new HttpPut());
}
@Override
public void execute() throws AxisFault {
- AbstractHttpClient httpClient = sender.getHttpClient(msgContext);
-
- HttpPut method = new HttpPut();
- MessageFormatter messageFormatter =
sender.populateCommonProperties(msgContext, url, method,
-
httpClient, soapActionString);
AxisRequestEntityImpl requestEntity =
new AxisRequestEntityImpl(messageFormatter, msgContext,
sender.getFormat(),
soapActionString,
sender.isChunked(), sender.isAllowedRetry());
Added:
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/RequestBase.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/RequestBase.java?rev=1778956&view=auto
==============================================================================
---
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/RequestBase.java
(added)
+++
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/RequestBase.java
Sun Jan 15 23:24:07 2017
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis2.transport.http.impl.httpclient4;
+
+import java.net.URL;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.transport.MessageFormatter;
+import org.apache.axis2.transport.http.Request;
+import org.apache.http.client.methods.HttpRequestBase;
+import org.apache.http.impl.client.AbstractHttpClient;
+
+abstract class RequestBase<T extends HttpRequestBase> implements Request {
+ protected final HTTPSenderImpl sender;
+ protected final String soapActionString;
+ protected final MessageContext msgContext;
+ protected final URL url;
+ protected final T method;
+ protected final AbstractHttpClient httpClient;
+ protected final MessageFormatter messageFormatter;
+
+ RequestBase(HTTPSenderImpl sender, String soapActionString, MessageContext
msgContext, URL url, T method) throws AxisFault {
+ this.sender = sender;
+ this.soapActionString = soapActionString;
+ this.msgContext = msgContext;
+ this.url = url;
+ this.method = method;
+ httpClient = sender.getHttpClient(msgContext);
+ messageFormatter = sender.populateCommonProperties(msgContext, url,
method,
+ httpClient, soapActionString);
+ }
+}