Package org.eclipse.jetty.client
Class HttpReceiver.ContentListeners
- java.lang.Object
-
- org.eclipse.jetty.client.HttpReceiver.ContentListeners
-
- Enclosing class:
- HttpReceiver
private class HttpReceiver.ContentListeners extends java.lang.Object
Wraps a list of content listeners, notifies them about content events and tracks individual listener demand to produce a global demand for content.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.function.LongConsumer
demand
private java.util.Map<java.lang.Object,java.lang.Long>
demands
private java.util.List<Response.DemandedContentListener>
listeners
-
Constructor Summary
Constructors Modifier Constructor Description private
ContentListeners(java.util.List<Response.ResponseListener> responseListeners)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
accept(java.lang.Object context, long value)
private void
demand(java.lang.Object context, long value)
private boolean
isEmpty()
private void
notifyBeforeContent(HttpResponse response)
private void
notifyContent(HttpResponse response, java.nio.ByteBuffer buffer, Callback callback)
-
-
-
Field Detail
-
demands
private final java.util.Map<java.lang.Object,java.lang.Long> demands
-
demand
private final java.util.function.LongConsumer demand
-
listeners
private final java.util.List<Response.DemandedContentListener> listeners
-
-
Constructor Detail
-
ContentListeners
private ContentListeners(java.util.List<Response.ResponseListener> responseListeners)
-
-
Method Detail
-
isEmpty
private boolean isEmpty()
-
notifyBeforeContent
private void notifyBeforeContent(HttpResponse response)
-
notifyContent
private void notifyContent(HttpResponse response, java.nio.ByteBuffer buffer, Callback callback)
-
demand
private void demand(java.lang.Object context, long value)
-
accept
private void accept(java.lang.Object context, long value)
-
-