Top Description Inners Fields Constructors Methods
org.eclipse.jetty.server.internal

public Class HttpConnection

extends AbstractMetaDataConnection
implements Runnable, Listener, UpgradeFrom, UpgradeTo, ConnectionMetaData
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.server.ConnectionMetaData, org.eclipse.jetty.util.Attributes, org.eclipse.jetty.io.Connection.UpgradeTo, org.eclipse.jetty.io.Connection.UpgradeFrom, org.eclipse.jetty.io.WriteFlusher.Listener, java.lang.Runnable
Imports
java.io.IOException, java.nio.ByteBuffer, java.nio.channels.WritePendingException, java.util.List, .Objects, .Set, java.util.concurrent.RejectedExecutionException, .TimeoutException, java.util.concurrent.atomic.AtomicBoolean, .AtomicLong, .AtomicReference, .LongAdder, org.eclipse.jetty.http.BadMessageException, .ComplianceViolation, .HostPortHttpField, .HttpCompliance, .HttpException, .HttpField, .HttpFields, .HttpGenerator, .HttpHeader, .HttpHeaderValue, .HttpMethod, .HttpParser, .HttpScheme, .HttpStatus, .HttpURI, .HttpVersion, .MetaData, .Trailers, .UriCompliance, org.eclipse.jetty.io.ByteBufferPool, .Connection, .Content, .EndPoint, .EofException, .RetainableByteBuffer, .RuntimeIOException, .WriteFlusher, org.eclipse.jetty.io.ssl.SslConnection, org.eclipse.jetty.server.AbstractMetaDataConnection, .ConnectionFactory, .ConnectionMetaData, .Connector, .HttpChannel, .HttpConfiguration, .HttpStream, .Request, .Server, .TunnelSupport, org.eclipse.jetty.util.BufferUtil, .Callback, .HostPort, .IteratingCallback, .StringUtil, .TypeUtil, org.eclipse.jetty.util.thread.Invocable, org.slf4j.Logger, .LoggerFactory

A Connection that handles the HTTP protocol.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
protected class
protected class
private class
private class

Field Summary

Modifier and TypeField and Description
private static final AtomicLong
private static final ThreadLocal<HttpConnection>
private final Attributes.Lazy
private final ByteBufferPool
private final HttpConnection.DemandContentCallback
private final HttpGenerator
private final AtomicBoolean
private final HttpFields.Mutable
private final HttpChannel
private final long
private Runnable
private final HttpParser
private final HttpConnection.RequestHandler
private long
private volatile RetainableByteBuffer
private final HttpConnection.SendCallback
private final AtomicReference<HttpConnection.HttpStreamOverHTTP1>
private final AtomicLong
private HttpFields.Mutable
private final TunnelSupport
private boolean
private boolean
private final LongAdder
private final LongAdder
private static final Logger
private static final HttpField

Constructor Summary

AccessConstructor and Description
public
HttpConnection(HttpConfiguration configuration, Connector connector, EndPoint endPoint, boolean recordComplianceViolations)
Deprecated for removal since 12.0.6. use HttpConnection(HttpConfiguration, Connector, EndPoint) instead.

public
HttpConnection(HttpConfiguration configuration, Connector connector, EndPoint endPoint)

Method Summary

Modifier and TypeMethod and Description
public void
public void
clearAttributes()

Overrides default org.eclipse.jetty.util.Attributes.clearAttributes.

Clear all attribute names

private int
public Object
getAttribute(String
the attribute to get
name
)

Implements org.eclipse.jetty.util.Attributes.getAttribute.

Get an attribute

public Set<String>
getAttributeNameSet()

Implements org.eclipse.jetty.util.Attributes.getAttributeNameSet.

Get the immutable set of attribute names.

public long
public long
public static HttpConnection

Returns:

the current HttpConnection or null
getCurrentConnection
()

Get the current connection that this thread is dispatched to.

public HttpGenerator
public HttpChannel
public HttpVersion
public String
public Invocable.InvocationType
public long
public long
public HttpParser
public String
private ByteBuffer
public Server
public boolean
public boolean
isRecordHttpComplianceViolations()
Deprecated for removal since 12.0.6. No replacement, no longer used within HttpConnection, will be removed in Jetty 12.1.0

public boolean
public boolean
public boolean
protected HttpChannel
newHttpChannel(Server server, HttpConfiguration configuration)

protected HttpGenerator
protected HttpParser
protected HttpConnection.HttpStreamOverHTTP1
newHttpStream(String method, String uri, HttpVersion version)

protected HttpConnection.RequestHandler
public void
onClose(Throwable
The cause of the close or null for a normal close
cause
)

Overrides org.eclipse.jetty.io.AbstractConnection.onClose.

Implements org.eclipse.jetty.io.Connection.onClose.

Callback method invoked when this connection is closed.

public void
onFillable()

Implements abstract org.eclipse.jetty.io.AbstractConnection.onFillable.

Callback method invoked when the endpoint is ready to be read.

protected void
onFillInterestedFailed(Throwable
the exception that caused the failure
cause
)

Overrides org.eclipse.jetty.io.AbstractConnection.onFillInterestedFailed.

Callback method invoked when the endpoint failed to be ready to be read.

public void
onFlushed(long
the number of bytes flushed
bytes
)

Implements org.eclipse.jetty.io.WriteFlusher.Listener.onFlushed.

Invoked when a WriteFlusher flushed bytes in a non-blocking way, as part of a - possibly larger - write.

public boolean
onIdleExpired(TimeoutException timeout)

Overrides org.eclipse.jetty.io.AbstractConnection.onIdleExpired.

Implements org.eclipse.jetty.io.Connection.onIdleExpired.

Callback method invoked upon an idle timeout event.

public void
onOpen()

Overrides org.eclipse.jetty.io.AbstractConnection.onOpen.

Implements org.eclipse.jetty.io.Connection.onOpen.

Callback method invoked when this connection is opened.

public ByteBuffer
onUpgradeFrom()

Implements org.eclipse.jetty.io.Connection.UpgradeFrom.onUpgradeFrom.

Invoked during an upgrade to produce a buffer containing bytes that have not been consumed by this connection, and that must be consumed by the upgrade-to connection.

public void
onUpgradeTo(ByteBuffer
a non-null buffer of unconsumed bytes received from the upgrade-from connection. The buffer does not belong to any pool and should be discarded after having consumed its bytes.
buffer
)

Implements org.eclipse.jetty.io.Connection.UpgradeTo.onUpgradeTo.

Invoked during an upgrade to receive a buffer containing bytes that have not been consumed by the upgrade-from connection, and that must be consumed by this connection.

pack-priv void
parseAndFillForContent()

Parse and fill data, looking for content.

private boolean
pack-priv void
public Object
removeAttribute(String
the attribute to remove
name
)

Implements org.eclipse.jetty.util.Attributes.removeAttribute.

Remove an attribute

public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

public Object
setAttribute(String
the attribute to set
name
,
Object
the value to set. A null value is equivalent to removing the attribute.
attribute
)

Implements org.eclipse.jetty.util.Attributes.setAttribute.

Set an attribute

protected static HttpConnection
public void
setUseInputDirectByteBuffers(boolean useInputDirectByteBuffers)

public void
setUseOutputDirectByteBuffers(boolean useOutputDirectByteBuffers)

public String
private boolean
Inherited from org.eclipse.jetty.server.AbstractMetaDataConnection:
getConnectiongetConnectorgetHttpConfigurationgetLocalSocketAddressgetRemoteSocketAddress