Package org.eclipse.jetty.client
Class HttpChannel
- java.lang.Object
-
- org.eclipse.jetty.client.HttpChannel
-
- All Implemented Interfaces:
CyclicTimeouts.Expirable
- Direct Known Subclasses:
HttpChannelOverFCGI,HttpChannelOverHTTP,HttpChannelOverHTTP2
public abstract class HttpChannel extends java.lang.Object implements CyclicTimeouts.Expirable
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedHttpChannel(HttpDestination destination)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanabort(HttpExchange exchange, java.lang.Throwable requestFailure, java.lang.Throwable responseFailure)booleanabortResponse(HttpExchange exchange, java.lang.Throwable failure)booleanassociate(HttpExchange exchange)Associates the givenexchangeto this channel in order to be sent over the network.voiddestroy()booleandisassociate(HttpExchange exchange)voidexchangeTerminated(HttpExchange exchange, Result result)ResultexchangeTerminating(HttpExchange exchange, Result result)longgetExpireNanoTime()Returns the expiration time in nanoseconds.HttpDestinationgetHttpDestination()HttpExchangegetHttpExchange()protected abstract HttpReceivergetHttpReceiver()protected abstract HttpSendergetHttpSender()voidproceed(HttpExchange exchange, java.lang.Throwable failure)abstract voidrelease()voidsend()abstract voidsend(HttpExchange exchange)java.lang.StringtoString()
-
-
-
Field Detail
-
LOG
protected static final Logger LOG
-
-
Constructor Detail
-
HttpChannel
protected HttpChannel(HttpDestination destination)
-
-
Method Detail
-
destroy
public void destroy()
-
getHttpDestination
public HttpDestination getHttpDestination()
-
associate
public boolean associate(HttpExchange exchange)
Associates the given
exchangeto 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
public boolean disassociate(HttpExchange exchange)
-
getHttpExchange
public HttpExchange getHttpExchange()
-
getExpireNanoTime
public long getExpireNanoTime()
Description copied from interface:CyclicTimeouts.ExpirableReturns the expiration time in nanoseconds.
The value to return must be calculated taking into account
System.nanoTime(), for example:expireNanoTime = System.nanoTime() + timeoutNanosReturning
Long.MAX_VALUEindicates that this entity does not expire.- Specified by:
getExpireNanoTimein interfaceCyclicTimeouts.Expirable- Returns:
- the expiration time in nanoseconds, or
Long.MAX_VALUEif this entity does not expire
-
getHttpSender
protected abstract HttpSender getHttpSender()
-
getHttpReceiver
protected abstract HttpReceiver getHttpReceiver()
-
send
public void send()
-
send
public abstract void send(HttpExchange exchange)
-
release
public abstract void release()
-
proceed
public void proceed(HttpExchange exchange, java.lang.Throwable failure)
-
abort
public boolean abort(HttpExchange exchange, java.lang.Throwable requestFailure, java.lang.Throwable responseFailure)
-
abortResponse
public boolean abortResponse(HttpExchange exchange, java.lang.Throwable failure)
-
exchangeTerminating
public Result exchangeTerminating(HttpExchange exchange, Result result)
-
exchangeTerminated
public void exchangeTerminated(HttpExchange exchange, Result result)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-