Class HttpChannel
java.lang.Object
org.eclipse.jetty.client.transport.HttpChannel
- All Implemented Interfaces:
CyclicTimeouts.Expirable
- Direct Known Subclasses:
HttpChannelOverFCGI
,HttpChannelOverHTTP
,HttpChannelOverHTTP2
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
abort
(HttpExchange exchange, Throwable requestFailure, Throwable responseFailure, Promise<Boolean> promise) void
abortResponse
(HttpExchange exchange, Throwable failure, Promise<Boolean> promise) boolean
associate
(HttpExchange exchange) Associates the givenexchange
to this channel in order to be sent over the network.void
destroy()
boolean
disassociate
(HttpExchange exchange) Disassociates the exchange from this channel.void
exchangeTerminated
(HttpExchange exchange, Result result) exchangeTerminating
(HttpExchange exchange, Result result) protected abstract Connection
long
Returns the expiration time in nanoseconds.Returns theHttpExchange
currently associated with this channel, possiblynull
.protected abstract HttpReceiver
protected abstract HttpSender
void
proceed
(HttpExchange exchange, Runnable proceedAction, Throwable failure) abstract void
release()
void
send()
abstract void
send
(HttpExchange exchange) toString()
-
Constructor Details
-
HttpChannel
-
-
Method Details
-
destroy
public void destroy() -
getHttpDestination
-
associate
Associates the given
exchange
to this channel in order to be sent over the network.If the association is successful, the exchange can be sent. Otherwise, the channel must be disposed because whoever terminated the exchange did not do it - it did not have the channel yet.
- Parameters:
exchange
- the exchange to associate- Returns:
- true if the association was successful, false otherwise
-
disassociate
Disassociates the exchange from this channel.
- Parameters:
exchange
- the current exchange that must be already completed- Returns:
- true if the exchange was disassociated, false otherwise
-
getHttpExchange
Returns the
HttpExchange
currently associated with this channel, possiblynull
.The exchange may be completed and disassociated concurrently, so callers must act atomically on the exchange.
- Returns:
- the
HttpExchange
currently associated with this channel, possiblynull
.
-
getConnection
-
getExpireNanoTime
public long getExpireNanoTime()Description copied from interface:CyclicTimeouts.Expirable
Returns the expiration time in nanoseconds.
The value to return must be calculated taking into account the current nanoTime, for example:
expireNanoTime = NanoTime.now() + timeoutNanos
Returning
Long.MAX_VALUE
indicates that this entity does not expire.- Specified by:
getExpireNanoTime
in interfaceCyclicTimeouts.Expirable
- Returns:
- the expiration time in nanoseconds, or
Long.MAX_VALUE
if this entity does not expire
-
getHttpSender
-
getHttpReceiver
-
send
public void send() -
send
-
release
public abstract void release() -
proceed
-
abort
public void abort(HttpExchange exchange, Throwable requestFailure, Throwable responseFailure, Promise<Boolean> promise) -
abortResponse
-
exchangeTerminating
-
exchangeTerminated
-
toString
-