hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1762076 - in /httpcomponents/httpcore/trunk/httpcore5-h2/src: main/java/org/apache/hc/core5/http2/nio/ main/java/org/apache/hc/core5/http2/nio/entity/ test/java/org/apache/hc/core5/http2/integration/
Date Fri, 23 Sep 2016 17:53:35 GMT
Author: olegk
Date: Fri Sep 23 17:53:35 2016
New Revision: 1762076

URL: http://svn.apache.org/viewvc?rev=1762076&view=rev
Log:
Added AsyncDataConsumer#capacity method

Modified:
    httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/AbstractAsyncExchangeHandler.java
    httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/AbstractAsyncPushHandler.java
    httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/AbstractClassicExchangeHandler.java
    httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/AsyncDataConsumer.java
    httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/BasicRequestConsumer.java
    httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/BasicResponseConsumer.java
    httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/entity/AbstractClassicEntityConsumer.java
    httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/entity/ByteArrayAsyncEntityConsumer.java
    httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/entity/NoopEntityConsumer.java
    httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/entity/StringAsyncEntityConsumer.java
    httpcomponents/httpcore/trunk/httpcore5-h2/src/test/java/org/apache/hc/core5/http2/integration/Http2IntegrationTest.java

Modified: httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/AbstractAsyncExchangeHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/AbstractAsyncExchangeHandler.java?rev=1762076&r1=1762075&r2=1762076&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/AbstractAsyncExchangeHandler.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/AbstractAsyncExchangeHandler.java
Fri Sep 23 17:53:35 2016
@@ -137,6 +137,11 @@ public abstract class AbstractAsyncExcha
     }
 
     @Override
+    public int capacity() {
+        return requestConsumer.capacity();
+    }
+
+    @Override
     public final void updateCapacity(final CapacityChannel capacityChannel) throws IOException
{
         requestConsumer.updateCapacity(capacityChannel);
     }

Modified: httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/AbstractAsyncPushHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/AbstractAsyncPushHandler.java?rev=1762076&r1=1762075&r2=1762076&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/AbstractAsyncPushHandler.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/AbstractAsyncPushHandler.java
Fri Sep 23 17:53:35 2016
@@ -84,6 +84,11 @@ public abstract class AbstractAsyncPushH
     }
 
     @Override
+    public int capacity() {
+        return responseConsumer.capacity();
+    }
+
+    @Override
     public final void updateCapacity(final CapacityChannel capacityChannel) throws IOException
{
         responseConsumer.updateCapacity(capacityChannel);
     }

Modified: httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/AbstractClassicExchangeHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/AbstractClassicExchangeHandler.java?rev=1762076&r1=1762075&r2=1762076&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/AbstractClassicExchangeHandler.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/AbstractClassicExchangeHandler.java
Fri Sep 23 17:53:35 2016
@@ -205,6 +205,11 @@ public abstract class AbstractClassicExc
     }
 
     @Override
+    public int capacity() {
+        return inputBuffer != null ? inputBuffer.available() : 0;
+    }
+
+    @Override
     public final void updateCapacity(final CapacityChannel capacityChannel) throws IOException
{
         if (inputBuffer != null) {
             inputBuffer.updateCapacity(capacityChannel);

Modified: httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/AsyncDataConsumer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/AsyncDataConsumer.java?rev=1762076&r1=1762075&r2=1762076&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/AsyncDataConsumer.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/AsyncDataConsumer.java
Fri Sep 23 17:53:35 2016
@@ -40,6 +40,8 @@ import org.apache.hc.core5.http.HttpExce
  */
 public interface AsyncDataConsumer extends ResourceHolder {
 
+    int capacity();
+
     void updateCapacity(CapacityChannel capacityChannel) throws IOException;
 
     void consume(ByteBuffer src) throws IOException;

Modified: httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/BasicRequestConsumer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/BasicRequestConsumer.java?rev=1762076&r1=1762075&r2=1762076&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/BasicRequestConsumer.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/BasicRequestConsumer.java
Fri Sep 23 17:53:35 2016
@@ -82,6 +82,11 @@ public class BasicRequestConsumer<T> imp
     }
 
     @Override
+    public int capacity() {
+        return dataConsumer.capacity();
+    }
+
+    @Override
     public void updateCapacity(final CapacityChannel capacityChannel) throws IOException
{
         dataConsumer.updateCapacity(capacityChannel);
     }

Modified: httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/BasicResponseConsumer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/BasicResponseConsumer.java?rev=1762076&r1=1762075&r2=1762076&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/BasicResponseConsumer.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/BasicResponseConsumer.java
Fri Sep 23 17:53:35 2016
@@ -77,6 +77,11 @@ public class BasicResponseConsumer<T> im
     }
 
     @Override
+    public int capacity() {
+        return dataConsumer.capacity();
+    }
+
+    @Override
     public void updateCapacity(final CapacityChannel capacityChannel) throws IOException
{
         dataConsumer.updateCapacity(capacityChannel);
     }

Modified: httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/entity/AbstractClassicEntityConsumer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/entity/AbstractClassicEntityConsumer.java?rev=1762076&r1=1762075&r2=1762076&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/entity/AbstractClassicEntityConsumer.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/entity/AbstractClassicEntityConsumer.java
Fri Sep 23 17:53:35 2016
@@ -64,6 +64,11 @@ public abstract class AbstractClassicEnt
     protected abstract T consumeData(ContentType contentType, InputStream inputStream) throws
IOException;
 
     @Override
+    public int capacity() {
+        return buffer.available();
+    }
+
+    @Override
     public final void updateCapacity(final CapacityChannel capacityChannel) throws IOException
{
         buffer.updateCapacity(capacityChannel);
     }

Modified: httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/entity/ByteArrayAsyncEntityConsumer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/entity/ByteArrayAsyncEntityConsumer.java?rev=1762076&r1=1762075&r2=1762076&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/entity/ByteArrayAsyncEntityConsumer.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/entity/ByteArrayAsyncEntityConsumer.java
Fri Sep 23 17:53:35 2016
@@ -57,6 +57,11 @@ public class ByteArrayAsyncEntityConsume
     }
 
     @Override
+    public int capacity() {
+        return capacityIncrement;
+    }
+
+    @Override
     public void updateCapacity(final CapacityChannel capacityChannel) throws IOException
{
         capacityChannel.update(capacityIncrement);
     }

Modified: httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/entity/NoopEntityConsumer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/entity/NoopEntityConsumer.java?rev=1762076&r1=1762075&r2=1762076&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/entity/NoopEntityConsumer.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/entity/NoopEntityConsumer.java
Fri Sep 23 17:53:35 2016
@@ -51,6 +51,11 @@ public final class NoopEntityConsumer im
     }
 
     @Override
+    public int capacity() {
+        return Integer.MAX_VALUE;
+    }
+
+    @Override
     public void updateCapacity(final CapacityChannel capacityChannel) throws IOException
{
         capacityChannel.update(Integer.MAX_VALUE);
     }

Modified: httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/entity/StringAsyncEntityConsumer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/entity/StringAsyncEntityConsumer.java?rev=1762076&r1=1762075&r2=1762076&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/entity/StringAsyncEntityConsumer.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/entity/StringAsyncEntityConsumer.java
Fri Sep 23 17:53:35 2016
@@ -55,6 +55,11 @@ public class StringAsyncEntityConsumer e
     }
 
     @Override
+    public int capacity() {
+        return capacityIncrement;
+    }
+
+    @Override
     public void updateCapacity(final CapacityChannel capacityChannel) throws IOException
{
         capacityChannel.update(capacityIncrement);
     }

Modified: httpcomponents/httpcore/trunk/httpcore5-h2/src/test/java/org/apache/hc/core5/http2/integration/Http2IntegrationTest.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5-h2/src/test/java/org/apache/hc/core5/http2/integration/Http2IntegrationTest.java?rev=1762076&r1=1762075&r2=1762076&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5-h2/src/test/java/org/apache/hc/core5/http2/integration/Http2IntegrationTest.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5-h2/src/test/java/org/apache/hc/core5/http2/integration/Http2IntegrationTest.java
Fri Sep 23 17:53:35 2016
@@ -377,6 +377,11 @@ public class Http2IntegrationTest extend
         }
 
         @Override
+        public int capacity() {
+            return buffer.remaining();
+        }
+
+        @Override
         public void updateCapacity(final CapacityChannel capacityChannel) throws IOException
{
             if (buffer.hasRemaining()) {
                 capacityChannel.update(buffer.remaining());



Mime
View raw message