hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject [29/34] httpcomponents-core git commit: Do not synchronize methods of BasicAsyncRequestProducer and BasicAsyncResponseProducer
Date Tue, 09 May 2017 20:02:58 GMT
Do not synchronize methods of BasicAsyncRequestProducer and BasicAsyncResponseProducer

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.3.x@1631090
13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/feefebfb
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/feefebfb
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/feefebfb

Branch: refs/heads/4.3.x
Commit: feefebfba2614d887d0371a3299b82c67cf4fd88
Parents: 9341fde
Author: Oleg Kalnichevski <olegk@apache.org>
Authored: Sat Oct 11 17:46:36 2014 +0000
Committer: Oleg Kalnichevski <olegk@apache.org>
Committed: Sat Oct 11 17:46:36 2014 +0000

----------------------------------------------------------------------
 .../http/nio/protocol/BasicAsyncRequestProducer.java    | 12 +++++-------
 .../http/nio/protocol/BasicAsyncResponseProducer.java   | 10 ++++------
 2 files changed, 9 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/feefebfb/httpcore-nio/src/main/java/org/apache/http/nio/protocol/BasicAsyncRequestProducer.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/nio/protocol/BasicAsyncRequestProducer.java
b/httpcore-nio/src/main/java/org/apache/http/nio/protocol/BasicAsyncRequestProducer.java
index 72cb9a0..3d49c32 100644
--- a/httpcore-nio/src/main/java/org/apache/http/nio/protocol/BasicAsyncRequestProducer.java
+++ b/httpcore-nio/src/main/java/org/apache/http/nio/protocol/BasicAsyncRequestProducer.java
@@ -32,7 +32,6 @@ import org.apache.http.HttpEntity;
 import org.apache.http.HttpEntityEnclosingRequest;
 import org.apache.http.HttpHost;
 import org.apache.http.HttpRequest;
-import org.apache.http.annotation.ThreadSafe;
 import org.apache.http.nio.ContentEncoder;
 import org.apache.http.nio.IOControl;
 import org.apache.http.nio.entity.EntityAsyncContentProducer;
@@ -50,7 +49,6 @@ import org.apache.http.util.Args;
  *
  * @since 4.2
  */
-@ThreadSafe
 public class BasicAsyncRequestProducer implements HttpAsyncRequestProducer {
 
     private final HttpHost target;
@@ -110,7 +108,7 @@ public class BasicAsyncRequestProducer implements HttpAsyncRequestProducer
{
         }
     }
 
-    public synchronized HttpRequest generateRequest() {
+    public HttpRequest generateRequest() {
         return this.request;
     }
 
@@ -118,7 +116,7 @@ public class BasicAsyncRequestProducer implements HttpAsyncRequestProducer
{
         return this.target;
     }
 
-    public synchronized void produceContent(
+    public void produceContent(
             final ContentEncoder encoder, final IOControl ioctrl) throws IOException {
         if (this.producer != null) {
             this.producer.produceContent(encoder, ioctrl);
@@ -134,17 +132,17 @@ public class BasicAsyncRequestProducer implements HttpAsyncRequestProducer
{
     public void failed(final Exception ex) {
     }
 
-    public synchronized boolean isRepeatable() {
+    public boolean isRepeatable() {
         return this.producer == null || this.producer.isRepeatable();
     }
 
-    public synchronized void resetRequest() throws IOException {
+    public void resetRequest() throws IOException {
         if (this.producer != null) {
             this.producer.close();
         }
     }
 
-    public synchronized void close() throws IOException {
+    public void close() throws IOException {
         if (this.producer != null) {
             this.producer.close();
         }

http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/feefebfb/httpcore-nio/src/main/java/org/apache/http/nio/protocol/BasicAsyncResponseProducer.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/nio/protocol/BasicAsyncResponseProducer.java
b/httpcore-nio/src/main/java/org/apache/http/nio/protocol/BasicAsyncResponseProducer.java
index d9e15f3..1693719 100644
--- a/httpcore-nio/src/main/java/org/apache/http/nio/protocol/BasicAsyncResponseProducer.java
+++ b/httpcore-nio/src/main/java/org/apache/http/nio/protocol/BasicAsyncResponseProducer.java
@@ -31,7 +31,6 @@ import java.io.IOException;
 
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
-import org.apache.http.annotation.ThreadSafe;
 import org.apache.http.nio.ContentEncoder;
 import org.apache.http.nio.IOControl;
 import org.apache.http.nio.entity.EntityAsyncContentProducer;
@@ -43,14 +42,13 @@ import org.apache.http.util.Args;
  * Basic implementation of {@link HttpAsyncResponseProducer}. The producer
  * can make use of the {@link HttpAsyncContentProducer} interface to
  * efficiently stream out message content to the underlying non-blocking HTTP
- * connection, if it is implemented by the {@link HttpEntity} inclosed in
+ * connection, if it is implemented by the {@link HttpEntity} enclosed in
  * the response.
  *
  * @see HttpAsyncContentProducer
  *
  * @since 4.2
  */
-@ThreadSafe
 public class BasicAsyncResponseProducer implements HttpAsyncResponseProducer {
 
     private final HttpResponse response;
@@ -99,11 +97,11 @@ public class BasicAsyncResponseProducer implements HttpAsyncResponseProducer
{
         }
     }
 
-    public synchronized HttpResponse generateResponse() {
+    public HttpResponse generateResponse() {
         return this.response;
     }
 
-    public synchronized void produceContent(
+    public void produceContent(
             final ContentEncoder encoder, final IOControl ioctrl) throws IOException {
         if (this.producer != null) {
             this.producer.produceContent(encoder, ioctrl);
@@ -119,7 +117,7 @@ public class BasicAsyncResponseProducer implements HttpAsyncResponseProducer
{
     public void failed(final Exception ex) {
     }
 
-    public synchronized void close() throws IOException {
+    public void close() throws IOException {
         if (this.producer != null) {
             this.producer.close();
         }


Mime
View raw message