Top Fields Constructors Methods
org.eclipse.jetty.client.transport.internal

public Class HttpReceiverOverHTTP

extends HttpReceiver
implements ResponseHandler
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.http.HttpParser.ResponseHandler, org.eclipse.jetty.http.HttpParser.HttpHandler
Imports
java.io.EOFException, java.nio.ByteBuffer, java.util.concurrent.atomic.LongAdder, org.eclipse.jetty.client.HttpClient, .HttpClientTransport, .HttpResponseException, org.eclipse.jetty.client.transport.HttpClientTransportOverHTTP, .HttpExchange, .HttpReceiver, .HttpResponse, org.eclipse.jetty.http.HttpException, .HttpField, .HttpMethod, .HttpParser, .HttpStatus, .HttpVersion, org.eclipse.jetty.io.ByteBufferPool, .Content, .EndPoint, .RetainableByteBuffer, org.eclipse.jetty.util.BufferUtil, .Promise, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
private Runnable
private final ByteBufferPool
private Content.Chunk
private boolean
private final LongAdder
private static final Logger
private String
private RetainableByteBuffer
private final HttpParser
private boolean
private int
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
public void
badMessage(HttpException
the failure with the bad message information
failure
)

Overrides default org.eclipse.jetty.http.HttpParser.HttpHandler.badMessage.

Called to signal that a bad HTTP message has been received.
private Content.Chunk
public boolean
public boolean
protected void
dispose()

Overrides org.eclipse.jetty.client.transport.HttpReceiver.dispose.

Disposes the state of this HttpReceiver.
public void
earlyEOF()

Implements org.eclipse.jetty.http.HttpParser.HttpHandler.earlyEOF.

Called to signal that an EOF was received unexpectedly during the parsing of an HTTP message
public void
failAndClose(Throwable
the failure.
failure
)

Implements abstract org.eclipse.jetty.client.transport.HttpReceiver.failAndClose.

Fails the receiver and closes the underlying stream.
protected void
private Runnable
public HttpChannelOverHTTP
private HttpConnectionOverHTTP
pack-priv long
protected ByteBuffer
public boolean
protected boolean
public boolean
private RetainableByteBuffer
protected void
onInterim()

Implements abstract org.eclipse.jetty.client.transport.HttpReceiver.onInterim.

Prepare for the next step after an interim response was read.
protected ByteBuffer
private boolean

Returns:

true to indicate that parsing should be interrupted (and will be resumed by another thread).
parse
()

Parses an HTTP response in the receivers buffer.

private boolean

Returns:

true if no bytes were filled.
parseAndFill
()

Parses the networkBuffer until the next content is generated or until the buffer is depleted.

public void
parsedHeader(HttpField
The field parsed
field
)

Implements org.eclipse.jetty.http.HttpParser.HttpHandler.parsedHeader.

This is the method called by parser when an HTTP Header name and value is found
public void
parsedTrailer(HttpField
The field parsed
trailer
)

Overrides default org.eclipse.jetty.http.HttpParser.HttpHandler.parsedTrailer.

This is the method called by parser when an HTTP Trailer name and value is found
private void
public Content.Chunk
read(boolean
true to register for fill interest when no data was read.
fillInterestIfNeeded
)

Implements abstract org.eclipse.jetty.client.transport.HttpReceiver.read.

Reads a chunk of data.
pack-priv void
private void
private void
protected void
reset()

Overrides org.eclipse.jetty.client.transport.HttpReceiver.reset.

Resets the state of this HttpReceiver.
private void
public void
startResponse(HttpVersion
the http version in use
version
,
int
the response status
status
,
String
the response reason phrase
reason
)

Implements org.eclipse.jetty.http.HttpParser.ResponseHandler.startResponse.

This is the method called by parser when the HTTP request line is parsed
public String
toString()

Overrides org.eclipse.jetty.client.transport.HttpReceiver.toString.

Returns a string representation of the object.
Inherited from org.eclipse.jetty.client.transport.HttpReceiver:
abortgetHttpDestinationgetHttpExchangehasContentisFailedresponseBeginresponseContentAvailableresponseFailureresponseHeaderresponseHeadersresponseSuccessstoreCookie

Field Detail

actionback to summary
private Runnable action
byteBufferPoolback to summary
private final ByteBufferPool byteBufferPool
chunkback to summary
private Content.Chunk chunk
completeback to summary
private boolean complete
inMessagesback to summary
private final LongAdder inMessages
LOGback to summary
private static final Logger LOG

Hides org.eclipse.jetty.client.transport.HttpReceiver.LOG.

methodback to summary
private String method
networkBufferback to summary
private RetainableByteBuffer networkBuffer
parserback to summary
private final HttpParser parser
shutdownback to summary
private boolean shutdown
statusback to summary
private int status
unsolicitedback to summary
private boolean unsolicited

Constructor Detail

HttpReceiverOverHTTPback to summary
public HttpReceiverOverHTTP(HttpChannelOverHTTP channel)

Method Detail

acquireNetworkBufferback to summary
private void acquireNetworkBuffer()
badMessageback to summary
public void badMessage(HttpException failure)

Overrides default org.eclipse.jetty.http.HttpParser.HttpHandler.badMessage.

Doc from org.eclipse.jetty.http.HttpParser.HttpHandler.badMessage.

Called to signal that a bad HTTP message has been received.

Parameters
failure:HttpException

the failure with the bad message information

Annotations
@Override
consumeChunkback to summary
private Content.Chunk consumeChunk()
contentback to summary
public boolean content(ByteBuffer buffer)

Implements org.eclipse.jetty.http.HttpParser.HttpHandler.content.

Annotations
@Override
contentCompleteback to summary
public boolean contentComplete()

Implements org.eclipse.jetty.http.HttpParser.HttpHandler.contentComplete.

Annotations
@Override
disposeback to summary
protected void dispose()

Overrides org.eclipse.jetty.client.transport.HttpReceiver.dispose.

Doc from org.eclipse.jetty.client.transport.HttpReceiver.dispose.

Disposes the state of this HttpReceiver.

Subclasses should override (but remember to call super) to dispose their own state.

Either this method or reset() is called.

Annotations
@Override
earlyEOFback to summary
public void earlyEOF()

Implements org.eclipse.jetty.http.HttpParser.HttpHandler.earlyEOF.

Doc from org.eclipse.jetty.http.HttpParser.HttpHandler.earlyEOF.

Called to signal that an EOF was received unexpectedly during the parsing of an HTTP message

Annotations
@Override
failAndCloseback to summary
public void failAndClose(Throwable failure)

Implements abstract org.eclipse.jetty.client.transport.HttpReceiver.failAndClose.

Doc from org.eclipse.jetty.client.transport.HttpReceiver.failAndClose.

Fails the receiver and closes the underlying stream.

Parameters
failure:Throwable

the failure.

Annotations
@Override
fillInterestedback to summary
protected void fillInterested()
getAndSetActionback to summary
private Runnable getAndSetAction(Runnable action)
getHttpChannelback to summary
public HttpChannelOverHTTP getHttpChannel()

Overrides org.eclipse.jetty.client.transport.HttpReceiver.getHttpChannel.

Annotations
@Override
getHttpConnectionback to summary
private HttpConnectionOverHTTP getHttpConnection()
getMessagesInback to summary
pack-priv long getMessagesIn()
getResponseBufferback to summary
protected ByteBuffer getResponseBuffer()
headerCompleteback to summary
public boolean headerComplete()

Implements org.eclipse.jetty.http.HttpParser.HttpHandler.headerComplete.

Annotations
@Override
isShutdownback to summary
protected boolean isShutdown()
messageCompleteback to summary
public boolean messageComplete()

Implements org.eclipse.jetty.http.HttpParser.HttpHandler.messageComplete.

Annotations
@Override
newNetworkBufferback to summary
private RetainableByteBuffer newNetworkBuffer()
onInterimback to summary
protected void onInterim()

Implements abstract org.eclipse.jetty.client.transport.HttpReceiver.onInterim.

Doc from org.eclipse.jetty.client.transport.HttpReceiver.onInterim.

Prepare for the next step after an interim response was read.

Annotations
@Override
onUpgradeFromback to summary
protected ByteBuffer onUpgradeFrom()
parseback to summary
private boolean parse()

Parses an HTTP response in the receivers buffer.

Returns:boolean

true to indicate that parsing should be interrupted (and will be resumed by another thread).

parseAndFillback to summary
private boolean parseAndFill()

Parses the networkBuffer until the next content is generated or until the buffer is depleted. If this method depletes the buffer, it will always try to re-fill until fill generates 0 byte.

Returns:boolean

true if no bytes were filled.

parsedHeaderback to summary
public void parsedHeader(HttpField field)

Implements org.eclipse.jetty.http.HttpParser.HttpHandler.parsedHeader.

Doc from org.eclipse.jetty.http.HttpParser.HttpHandler.parsedHeader.

This is the method called by parser when an HTTP Header name and value is found

Parameters
field:HttpField

The field parsed

Annotations
@Override
parsedTrailerback to summary
public void parsedTrailer(HttpField trailer)

Overrides default org.eclipse.jetty.http.HttpParser.HttpHandler.parsedTrailer.

Doc from org.eclipse.jetty.http.HttpParser.HttpHandler.parsedTrailer.

This is the method called by parser when an HTTP Trailer name and value is found

Parameters
trailer:HttpField

The field parsed

Annotations
@Override
reacquireNetworkBufferback to summary
private void reacquireNetworkBuffer()
readback to summary
public Content.Chunk read(boolean fillInterestIfNeeded)

Implements abstract org.eclipse.jetty.client.transport.HttpReceiver.read.

Doc from org.eclipse.jetty.client.transport.HttpReceiver.read.

Reads a chunk of data.

If no data was read, null is returned and if fillInterestIfNeeded is true then fill interest is registered.

The returned chunk of data may be the last one or an error exactly like Content.Source#read() specifies.

Parameters
fillInterestIfNeeded:boolean

true to register for fill interest when no data was read.

Returns:Content.Chunk

the chunk of data that was read, or null if nothing was read.

Annotations
@Override
receiveback to summary
pack-priv void receive()
receiveNextback to summary
private void receiveNext()
releaseNetworkBufferback to summary
private void releaseNetworkBuffer()
resetback to summary
protected void reset()

Overrides org.eclipse.jetty.client.transport.HttpReceiver.reset.

Doc from org.eclipse.jetty.client.transport.HttpReceiver.reset.

Resets the state of this HttpReceiver.

Subclasses should override (but remember to call super) to reset their own state.

Either this method or dispose() is called.

Annotations
@Override
shutdownback to summary
private void shutdown()
startResponseback to summary
public void startResponse(HttpVersion version, int status, String reason)

Implements org.eclipse.jetty.http.HttpParser.ResponseHandler.startResponse.

Doc from org.eclipse.jetty.http.HttpParser.ResponseHandler.startResponse.

This is the method called by parser when the HTTP request line is parsed

Parameters
version:HttpVersion

the http version in use

status:int

the response status

reason:String

the response reason phrase

Annotations
@Override
toStringback to summary
public String toString()

Overrides org.eclipse.jetty.client.transport.HttpReceiver.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override