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

public abstract Class HttpConnection

extends Object
implements IConnection, Attachable
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.util.Attachable, org.eclipse.jetty.client.transport.IConnection, org.eclipse.jetty.client.Connection, java.io.Closeable, java.lang.AutoCloseable
Known Direct Subclasses
org.eclipse.jetty.client.transport.internal.HttpConnectionOverHTTP.Delegate
Imports
java.net.URI, java.util.Iterator, .List, java.util.concurrent.TimeoutException, org.eclipse.jetty.client.Authentication, .AuthenticationStore, .BytesRequestContent, .HttpClient, .HttpProxy, .HttpRequestException, .ProxyConfiguration, .Request, .Response, org.eclipse.jetty.http.HttpCookie, .HttpCookieStore, .HttpField, .HttpFields, .HttpHeader, org.eclipse.jetty.io.CyclicTimeouts, org.eclipse.jetty.util.Attachable, .NanoTime, org.eclipse.jetty.util.thread.AutoLock, .Scheduler, org.slf4j.Logger, .LoggerFactory

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
HttpConnection.RequestTimeouts

Enforces the total timeout for requests that have been sent.

Field Summary

Modifier and TypeField and Description
private Object
private final HttpDestination
private int
private long
private final AutoLock
private static final Logger
private final HttpConnection.RequestTimeouts

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
private void
private void
private StringBuilder
public void
public Object
protected abstract Iterator<HttpChannel>
public HttpClient
public HttpDestination
protected void
public boolean
onIdleTimeout(long idleTimeout, Throwable failure)

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.

protected SendFailure
send(HttpChannel channel, HttpExchange exchange)

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 String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

attachmentback to summary
private Object attachment
destinationback to summary
private final HttpDestination destination
idleTimeoutGuardback to summary
private int idleTimeoutGuard
idleTimeoutNanoTimeback to summary
private long idleTimeoutNanoTime
lockback to summary
private final AutoLock lock
LOGback to summary
private static final Logger LOG
requestTimeoutsback to summary
private final HttpConnection.RequestTimeouts requestTimeouts

Constructor Detail

HttpConnectionback to summary
protected HttpConnection(HttpDestination destination)

Method Detail

applyProxyAuthenticationback to summary
private void applyProxyAuthentication(Request request, ProxyConfiguration.Proxy proxy)
applyRequestAuthenticationback to summary
private void applyRequestAuthentication(Request request)
convertCookiesback to summary
private StringBuilder convertCookies(List<HttpCookie> cookies, StringBuilder builder)
destroyback to summary
public void destroy()
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
getHttpChannelsback to summary
protected abstract Iterator<HttpChannel> getHttpChannels()
getHttpClientback to summary
public HttpClient getHttpClient()
getHttpDestinationback to summary
public HttpDestination getHttpDestination()
normalizeRequestback to summary
protected void normalizeRequest(HttpRequest request)
onIdleTimeoutback to summary
public boolean onIdleTimeout(long idleTimeout, Throwable failure)
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
protected SendFailure send(HttpChannel channel, HttpExchange exchange)
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
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

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

private Class HttpConnection.RequestTimeouts

extends CyclicTimeouts<HttpChannel>
Class Inheritance

Enforces the total timeout for requests that have been sent.

The total timeout for exchanges that are in the destination queue is enforced in HttpDestination.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
protected Iterator<HttpChannel>
protected boolean
onExpired(HttpChannel
the entity that is expired
channel
)

Implements abstract org.eclipse.jetty.io.CyclicTimeouts.onExpired.

Invoked during the iteration when the given entity is expired.

Inherited from org.eclipse.jetty.io.CyclicTimeouts:
destroyschedule

Constructor Detail

RequestTimeoutsback to summary
private RequestTimeouts(Scheduler scheduler)

Method Detail

iteratorback to summary
protected Iterator<HttpChannel> iterator()

Implements abstract org.eclipse.jetty.io.CyclicTimeouts.iterator.

Returns:Iterator<HttpChannel>

Doc from org.eclipse.jetty.io.CyclicTimeouts.iterator.

the entities to iterate over when this instance expires

Annotations
@Override
onExpiredback to summary
protected boolean onExpired(HttpChannel channel)

Implements abstract org.eclipse.jetty.io.CyclicTimeouts.onExpired.

Doc from org.eclipse.jetty.io.CyclicTimeouts.onExpired.

Invoked during the iteration when the given entity is expired.

This method may be invoked multiple times, and even concurrently, for the same expirable entity and therefore the expiration of the entity, if any, should be an idempotent action.

When false is returned, the implementation should adjust the Expirable expiration, so that a call to Expirable#getExpireNanoTime() after this method has returned yields a new expiration nanoTime.

Parameters
channel:HttpChannel

the entity that is expired

Returns:boolean

whether the entity should be removed from the iterator via Iterator#remove()

Annotations
@Override