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

public Class HttpConnectionOverHTTP

extends AbstractConnection
implements IConnection, UpgradeFrom, Sweepable, Attachable
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.util.Attachable, org.eclipse.jetty.util.thread.Sweeper.Sweepable, org.eclipse.jetty.io.Connection.UpgradeFrom, org.eclipse.jetty.client.transport.IConnection, org.eclipse.jetty.client.Connection, java.io.Closeable, java.lang.AutoCloseable
Imports
java.net.SocketAddress, java.nio.ByteBuffer, java.nio.channels.AsynchronousCloseException, java.util.Collections, .Iterator, .Map, java.util.concurrent.TimeUnit, .TimeoutException, java.util.concurrent.atomic.AtomicBoolean, .AtomicInteger, .LongAdder, org.eclipse.jetty.client.Connection, .HttpClientTransport, .HttpUpgrader, .Request, .Response, org.eclipse.jetty.client.internal.TunnelRequest, org.eclipse.jetty.client.transport.HttpChannel, .HttpConnection, .HttpConversation, .HttpDestination, .HttpExchange, .HttpRequest, .IConnection, .SendFailure, org.eclipse.jetty.http.HttpHeader, .HttpVersion, org.eclipse.jetty.io.AbstractConnection, .EndPoint, org.eclipse.jetty.util.Attachable, .Promise, org.eclipse.jetty.util.thread.Sweeper, org.slf4j.Logger, .LoggerFactory

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private final LongAdder
private final LongAdder
private final HttpChannelOverHTTP
private final AtomicBoolean
private final HttpConnectionOverHTTP.Delegate
private long
private static final Logger
private final Promise<Connection>
private final AtomicInteger

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
protected void
abort(Throwable failure, Promise<Boolean> promise)

protected void
addBytesIn(long bytesIn)

protected void
addBytesOut(long bytesOut)

public void
close()

Overrides org.eclipse.jetty.io.AbstractConnection.close.

Implements org.eclipse.jetty.client.Connection.close, org.eclipse.jetty.io.Connection.close.

Closes this stream and releases any system resources associated with it.
protected void
close(Throwable failure)

private static HttpDestination
public Object
public long
public long
public HttpChannelOverHTTP
public HttpDestination
public SocketAddress
public long
public long
public SocketAddress
public boolean
protected HttpChannelOverHTTP
public void
onFillable()

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

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

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.

protected boolean
onIdleTimeout(long idleTimeout)

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.

pack-priv void
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.

private static Promise<Connection>
public void
public void
public void
send(Request
the request to send
request
,
Response.CompleteListener
the response listener
listener
)

Implements org.eclipse.jetty.client.Connection.send.

Sends a request with an associated response listener.
public SendFailure
public void
setAttachment(Object
the object to attach to this instance
obj
)

Implements org.eclipse.jetty.util.Attachable.setAttachment.

Attaches the given object to this stream for later retrieval.
public boolean
public String
Inherited from org.eclipse.jetty.io.AbstractConnection:
addEventListenerfailedCallbackfillInterestedgetCreatedTimeStampgetEndPointgetExecutorgetInputBufferSizegetInvocationTypeisFillInterestedonCloseonFillInterestedFailedonReadTimeoutremoveEventListenersetInputBufferSizetoStringtryFillInterested

Field Detail

bytesInback to summary
private final LongAdder bytesIn
bytesOutback to summary
private final LongAdder bytesOut
channelback to summary
private final HttpChannelOverHTTP channel
closedback to summary
private final AtomicBoolean closed
delegateback to summary
private final HttpConnectionOverHTTP.Delegate delegate
idleTimeoutback to summary
private long idleTimeout
LOGback to summary
private static final Logger LOG

Hides org.eclipse.jetty.io.AbstractConnection.LOG.

promiseback to summary
private final Promise<Connection> promise
sweepsback to summary
private final AtomicInteger sweeps

Constructor Detail

HttpConnectionOverHTTPback to summary
public HttpConnectionOverHTTP(EndPoint endPoint, Map<String, Object> context)
HttpConnectionOverHTTPback to summary
public HttpConnectionOverHTTP(EndPoint endPoint, HttpDestination destination, Promise<Connection> promise)

Method Detail

abortback to summary
protected void abort(Throwable failure, Promise<Boolean> promise)
addBytesInback to summary
protected void addBytesIn(long bytesIn)
addBytesOutback to summary
protected void addBytesOut(long bytesOut)
closeback to summary
public void close()

Overrides org.eclipse.jetty.io.AbstractConnection.close.

Implements org.eclipse.jetty.client.Connection.close, org.eclipse.jetty.io.Connection.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
closeback to summary
protected void close(Throwable failure)
destinationFromback to summary
private static HttpDestination destinationFrom(Map<String, Object> context)
getAttachmentback to summary
public Object getAttachment()

Implements org.eclipse.jetty.util.Attachable.getAttachment.

Returns:Object

Doc from org.eclipse.jetty.util.Attachable.getAttachment.

the object attached to this instance

Annotations
@Override
getBytesInback to summary
public long getBytesIn()

Overrides org.eclipse.jetty.io.AbstractConnection.getBytesIn.

Implements org.eclipse.jetty.io.Connection.getBytesIn.

Annotations
@Override
getBytesOutback to summary
public long getBytesOut()

Overrides org.eclipse.jetty.io.AbstractConnection.getBytesOut.

Implements org.eclipse.jetty.io.Connection.getBytesOut.

Annotations
@Override
getHttpChannelback to summary
public HttpChannelOverHTTP getHttpChannel()
getHttpDestinationback to summary
public HttpDestination getHttpDestination()
getLocalSocketAddressback to summary
public SocketAddress getLocalSocketAddress()

Overrides default org.eclipse.jetty.client.Connection.getLocalSocketAddress.

Returns:SocketAddress

Doc from org.eclipse.jetty.client.Connection.getLocalSocketAddress.

the local socket address associated with the connection

Annotations
@Override
getMessagesInback to summary
public long getMessagesIn()

Overrides org.eclipse.jetty.io.AbstractConnection.getMessagesIn.

Implements org.eclipse.jetty.io.Connection.getMessagesIn.

Annotations
@Override
getMessagesOutback to summary
public long getMessagesOut()

Overrides org.eclipse.jetty.io.AbstractConnection.getMessagesOut.

Implements org.eclipse.jetty.io.Connection.getMessagesOut.

Annotations
@Override
getRemoteSocketAddressback to summary
public SocketAddress getRemoteSocketAddress()

Overrides default org.eclipse.jetty.client.Connection.getRemoteSocketAddress.

Returns:SocketAddress

Doc from org.eclipse.jetty.client.Connection.getRemoteSocketAddress.

the remote socket address associated with the connection

Annotations
@Override
isClosedback to summary
public boolean isClosed()

Implements org.eclipse.jetty.client.Connection.isClosed.

Returns:boolean

Doc from org.eclipse.jetty.client.Connection.isClosed.

whether this connection has been closed

Annotations
@Override
newHttpChannelback to summary
protected HttpChannelOverHTTP newHttpChannel()
onFillableback to summary
public void onFillable()

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

Doc from org.eclipse.jetty.io.AbstractConnection.onFillable.

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

Annotations
@Override
onIdleExpiredback to summary
public boolean onIdleExpired(TimeoutException timeout)

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

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

Doc from org.eclipse.jetty.io.Connection.onIdleExpired.

Callback method invoked upon an idle timeout event.

Implementations of this method may return true to indicate that the idle timeout handling should proceed normally, typically failing the EndPoint and causing it to be closed.

When false is returned, the handling of the idle timeout event is halted immediately and the EndPoint left in the state it was before the idle timeout event.

Returns:boolean

true to let the EndPoint handle the idle timeout, false to tell the EndPoint to halt the handling of the idle timeout.

Annotations
@Override
onIdleTimeoutback to summary
protected boolean onIdleTimeout(long idleTimeout)
onOpenback to summary
public void onOpen()

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

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

Doc from org.eclipse.jetty.io.Connection.onOpen.

Callback method invoked when this connection is opened.

Creators of the connection implementation are responsible for calling this method.

Annotations
@Override
onResponseHeadersback to summary
pack-priv void onResponseHeaders(HttpExchange exchange)
onUpgradeFromback to summary
public ByteBuffer onUpgradeFrom()

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

Doc from 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.

Returns:ByteBuffer

a buffer of unconsumed bytes to pass to the upgrade-to connection. The buffer does not belong to any pool and should be discarded after having consumed its bytes. The returned buffer may be null if there are no unconsumed bytes.

Annotations
@Override
promiseFromback to summary
private static Promise<Connection> promiseFrom(Map<String, Object> context)
Annotations
@SuppressWarnings:unchecked
releaseback to summary
public void release()
removeback to summary
public void remove()
sendback to summary
public void send(Request request, Response.CompleteListener listener)

Implements org.eclipse.jetty.client.Connection.send.

Doc from org.eclipse.jetty.client.Connection.send.

Sends a request with an associated response listener.

Request#send(Response.CompleteListener) will eventually call this method to send the request. It is exposed to allow applications to send requests via unpooled connections.

Parameters
request:Request

the request to send

listener:Response.CompleteListener

the response listener

Annotations
@Override
sendback to summary
public SendFailure send(HttpExchange exchange)

Implements org.eclipse.jetty.client.transport.IConnection.send.

Annotations
@Override
setAttachmentback to summary
public void setAttachment(Object obj)

Implements org.eclipse.jetty.util.Attachable.setAttachment.

Doc from org.eclipse.jetty.util.Attachable.setAttachment.

Attaches the given object to this stream for later retrieval.

Parameters
obj:Object

the object to attach to this instance

Annotations
@Override
sweepback to summary
public boolean sweep()

Implements org.eclipse.jetty.util.thread.Sweeper.Sweepable.sweep.

Returns:boolean

Doc from org.eclipse.jetty.util.thread.Sweeper.Sweepable.sweep.

whether this resource should be swept

Annotations
@Override
toConnectionStringback to summary
public String toConnectionString()

Overrides org.eclipse.jetty.io.AbstractConnection.toConnectionString.

Annotations
@Override
org.eclipse.jetty.client.transport.internal back to summary

private Class HttpConnectionOverHTTP.Delegate

extends HttpConnection
Class Inheritance

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements org.eclipse.jetty.client.Connection.close.

Closes this stream and releases any system resources associated with it.
protected Iterator<HttpChannel>
public SocketAddress
public SocketAddress
public boolean
protected void
public SendFailure
public String
toString()

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

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

Constructor Detail

Delegateback to summary
private Delegate(HttpDestination destination)

Method Detail

closeback to summary
public void close()

Implements org.eclipse.jetty.client.Connection.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
getHttpChannelsback to summary
protected Iterator<HttpChannel> getHttpChannels()

Implements abstract org.eclipse.jetty.client.transport.HttpConnection.getHttpChannels.

Annotations
@Override
getLocalSocketAddressback to summary
public SocketAddress getLocalSocketAddress()

Overrides default org.eclipse.jetty.client.Connection.getLocalSocketAddress.

Returns:SocketAddress

Doc from org.eclipse.jetty.client.Connection.getLocalSocketAddress.

the local socket address associated with the connection

Annotations
@Override
getRemoteSocketAddressback to summary
public SocketAddress getRemoteSocketAddress()

Overrides default org.eclipse.jetty.client.Connection.getRemoteSocketAddress.

Returns:SocketAddress

Doc from org.eclipse.jetty.client.Connection.getRemoteSocketAddress.

the remote socket address associated with the connection

Annotations
@Override
isClosedback to summary
public boolean isClosed()

Implements org.eclipse.jetty.client.Connection.isClosed.

Returns:boolean

Doc from org.eclipse.jetty.client.Connection.isClosed.

whether this connection has been closed

Annotations
@Override
normalizeRequestback to summary
protected void normalizeRequest(HttpRequest request)

Overrides org.eclipse.jetty.client.transport.HttpConnection.normalizeRequest.

Annotations
@Override
sendback to summary
public SendFailure send(HttpExchange exchange)

Implements org.eclipse.jetty.client.transport.IConnection.send.

Annotations
@Override
toStringback to summary
public String toString()

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

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override