Package org.eclipse.jetty.server
Class HttpChannel
- java.lang.Object
-
- org.eclipse.jetty.server.HttpChannel
-
- All Implemented Interfaces:
Runnable
,HttpOutput.Interceptor
- Direct Known Subclasses:
HttpChannelOverHttp
@Deprecated(since="2021-05-27") public class HttpChannel extends Object implements Runnable, HttpOutput.Interceptor
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.HttpChannel represents a single endpoint for HTTP semantic processing. The HttpChannel is both an HttpParser.RequestHandler, where it passively receives events from an incoming HTTP request, and a Runnable, where it actively takes control of the request/response life cycle and calls the application (perhaps suspending and resuming with multiple calls to run). The HttpChannel signals the switch from passive mode to active mode by returning true to one of the HttpParser.RequestHandler callbacks. The completion of the active phase is signalled by a call to HttpTransport.completed().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
HttpChannel.Listener
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.static class
HttpChannel.TransientListeners
Deprecated.
-
Field Summary
Fields Modifier and Type Field Description static HttpChannel.Listener
NOOP_LISTENER
Deprecated.
-
Constructor Summary
Constructors Constructor Description HttpChannel(Connector connector, HttpConfiguration configuration, EndPoint endPoint, HttpTransport transport)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
abort(Throwable failure)
Deprecated.If a write or similar operation to this channel fails, then this method should be called.boolean
addListener(HttpChannel.Listener listener)
Deprecated.void
addRequestLog(RequestLog requestLog)
Deprecated.void
continue100(int available)
Deprecated.If the associated response has the Expect header set to 100 Continue, then accessing the input stream indicates that the handler/servlet is ready for the request body and thus a 100 Continue response is sent.void
ensureConsumeAllOrNotPersistent()
Deprecated.ByteBufferPool
getByteBufferPool()
Deprecated.long
getBytesWritten()
Deprecated.MetaData.Response
getCommittedMetaData()
Deprecated.Connection
getConnection()
Deprecated.Connector
getConnector()
Deprecated.EndPoint
getEndPoint()
Deprecated.HttpConfiguration
getHttpConfiguration()
Deprecated.HttpTransport
getHttpTransport()
Deprecated.long
getIdleTimeout()
Deprecated.Get the idle timeout.InetSocketAddress
getLocalAddress()
Deprecated.HttpOutput.Interceptor
getNextInterceptor()
Deprecated.InetSocketAddress
getRemoteAddress()
Deprecated.Request
getRequest()
Deprecated.RequestLog
getRequestLog()
Deprecated.long
getRequests()
Deprecated.Response
getResponse()
Deprecated.Scheduler
getScheduler()
Deprecated.Server
getServer()
Deprecated.HttpChannelState
getState()
Deprecated.List<HttpChannel.Listener>
getTransientListeners()
Deprecated.boolean
handle()
Deprecated.boolean
isCommitted()
Deprecated.boolean
isExpecting100Continue()
Deprecated.boolean
isExpecting102Processing()
Deprecated.boolean
isOptimizedForDirectBuffers()
Deprecated.boolean
isPersistent()
Deprecated.boolean
isRequestCompleted()
Deprecated.boolean
isResponseCompleted()
Deprecated.boolean
isSendError()
Deprecated.void
onAsyncWaitForContent()
Deprecated.void
onBadMessage(BadMessageException failure)
Deprecated.void
onBlockWaitForContent()
Deprecated.void
onBlockWaitForContentFailure(Throwable failure)
Deprecated.void
onCompleted()
Deprecated.boolean
onContent(HttpInput.Content content)
Deprecated.boolean
onContentComplete()
Deprecated.boolean
onEarlyEOF()
Deprecated.void
onRequest(MetaData.Request request)
Deprecated.boolean
onRequestComplete()
Deprecated.void
onTrailers(HttpFields trailers)
Deprecated.void
recycle()
Deprecated.boolean
removeListener(HttpChannel.Listener listener)
Deprecated.void
resetBuffer()
Deprecated.Reset the buffers.void
run()
Deprecated.boolean
sendResponse(MetaData.Response info, ByteBuffer content, boolean complete)
Deprecated.boolean
sendResponse(MetaData.Response info, ByteBuffer content, boolean complete, Callback callback)
Deprecated.void
sendResponseAndComplete()
Deprecated.void
setIdleTimeout(long timeoutMs)
Deprecated.Set the idle timeout.void
setRequestLog(RequestLog requestLog)
Deprecated.String
toString()
Deprecated.boolean
useDirectBuffers()
Deprecated.void
write(ByteBuffer content, boolean complete, Callback callback)
Deprecated.Non-Blocking write, committing the response if needed.
-
-
-
Field Detail
-
NOOP_LISTENER
public static HttpChannel.Listener NOOP_LISTENER
Deprecated.
-
-
Constructor Detail
-
HttpChannel
public HttpChannel(Connector connector, HttpConfiguration configuration, EndPoint endPoint, HttpTransport transport)
Deprecated.
-
-
Method Detail
-
isSendError
public boolean isSendError()
Deprecated.
-
getState
public HttpChannelState getState()
Deprecated.
-
addListener
@Deprecated public boolean addListener(HttpChannel.Listener listener)
Deprecated.Add a transient Listener to the HttpChannel.Listeners added by this method will only be notified if the HttpChannel has been constructed with an instance of
HttpChannel.TransientListeners
as anAbstractConnector
provided listenerTransient listeners are removed after every request cycle
- Parameters:
listener
-- Returns:
- true if the listener was added.
-
removeListener
@Deprecated public boolean removeListener(HttpChannel.Listener listener)
Deprecated.
-
getTransientListeners
@Deprecated public List<HttpChannel.Listener> getTransientListeners()
Deprecated.
-
getBytesWritten
public long getBytesWritten()
Deprecated.
-
getRequests
public long getRequests()
Deprecated.- Returns:
- the number of requests handled by this connection
-
getConnector
public Connector getConnector()
Deprecated.
-
getHttpTransport
public HttpTransport getHttpTransport()
Deprecated.
-
getRequestLog
public RequestLog getRequestLog()
Deprecated.
-
setRequestLog
public void setRequestLog(RequestLog requestLog)
Deprecated.
-
addRequestLog
public void addRequestLog(RequestLog requestLog)
Deprecated.
-
getCommittedMetaData
public MetaData.Response getCommittedMetaData()
Deprecated.
-
getIdleTimeout
public long getIdleTimeout()
Deprecated.Get the idle timeout.This is implemented as a call to
EndPoint.getIdleTimeout()
, but may be overridden by channels that have timeouts different from their connections.- Returns:
- the idle timeout (in milliseconds)
-
setIdleTimeout
public void setIdleTimeout(long timeoutMs)
Deprecated.Set the idle timeout.This is implemented as a call to
EndPoint.setIdleTimeout(long)
, but may be overridden by channels that have timeouts different from their connections.- Parameters:
timeoutMs
- the idle timeout in milliseconds
-
getByteBufferPool
public ByteBufferPool getByteBufferPool()
Deprecated.
-
getHttpConfiguration
public HttpConfiguration getHttpConfiguration()
Deprecated.
-
isOptimizedForDirectBuffers
public boolean isOptimizedForDirectBuffers()
Deprecated.- Specified by:
isOptimizedForDirectBuffers
in interfaceHttpOutput.Interceptor
- Returns:
- True if the Interceptor is optimized to receive direct
ByteBuffer
s in theHttpOutput.Interceptor.write(ByteBuffer, boolean, Callback)
method. If false is returned, then passing direct buffers may cause inefficiencies.
-
getServer
public Server getServer()
Deprecated.
-
getRequest
public Request getRequest()
Deprecated.
-
getResponse
public Response getResponse()
Deprecated.
-
getConnection
public Connection getConnection()
Deprecated.
-
getEndPoint
public EndPoint getEndPoint()
Deprecated.
-
getLocalAddress
public InetSocketAddress getLocalAddress()
Deprecated.
-
getRemoteAddress
public InetSocketAddress getRemoteAddress()
Deprecated.
-
continue100
public void continue100(int available) throws IOException
Deprecated.If the associated response has the Expect header set to 100 Continue, then accessing the input stream indicates that the handler/servlet is ready for the request body and thus a 100 Continue response is sent.- Parameters:
available
- estimate of the number of bytes that are available- Throws:
IOException
- if the InputStream cannot be created
-
recycle
public void recycle()
Deprecated.
-
onAsyncWaitForContent
public void onAsyncWaitForContent()
Deprecated.
-
onBlockWaitForContent
public void onBlockWaitForContent()
Deprecated.
-
onBlockWaitForContentFailure
public void onBlockWaitForContentFailure(Throwable failure)
Deprecated.
-
handle
public boolean handle()
Deprecated.- Returns:
- True if the channel is ready to continue handling (ie it is not suspended)
-
ensureConsumeAllOrNotPersistent
public void ensureConsumeAllOrNotPersistent()
Deprecated.
-
sendResponseAndComplete
public void sendResponseAndComplete()
Deprecated.
-
isExpecting100Continue
public boolean isExpecting100Continue()
Deprecated.
-
isExpecting102Processing
public boolean isExpecting102Processing()
Deprecated.
-
onRequest
public void onRequest(MetaData.Request request)
Deprecated.
-
onContent
public boolean onContent(HttpInput.Content content)
Deprecated.
-
onContentComplete
public boolean onContentComplete()
Deprecated.
-
onTrailers
public void onTrailers(HttpFields trailers)
Deprecated.
-
onRequestComplete
public boolean onRequestComplete()
Deprecated.
-
onCompleted
public void onCompleted()
Deprecated.
-
onEarlyEOF
public boolean onEarlyEOF()
Deprecated.
-
onBadMessage
public void onBadMessage(BadMessageException failure)
Deprecated.
-
sendResponse
public boolean sendResponse(MetaData.Response info, ByteBuffer content, boolean complete, Callback callback)
Deprecated.
-
sendResponse
public boolean sendResponse(MetaData.Response info, ByteBuffer content, boolean complete) throws IOException
Deprecated.- Throws:
IOException
-
isCommitted
public boolean isCommitted()
Deprecated.
-
isRequestCompleted
public boolean isRequestCompleted()
Deprecated.- Returns:
- True if the request lifecycle is completed
-
isResponseCompleted
public boolean isResponseCompleted()
Deprecated.- Returns:
- True if the response is completely written.
-
isPersistent
public boolean isPersistent()
Deprecated.
-
write
public void write(ByteBuffer content, boolean complete, Callback callback)
Deprecated.Non-Blocking write, committing the response if needed.
Called as last link in HttpOutput.Filter chain- Specified by:
write
in interfaceHttpOutput.Interceptor
- Parameters:
content
- the content buffer to writecomplete
- whether the content is complete for the responsecallback
- Callback when complete or failed
-
resetBuffer
public void resetBuffer()
Deprecated.Description copied from interface:HttpOutput.Interceptor
Reset the buffers.If the Interceptor contains buffers then reset them.
- Specified by:
resetBuffer
in interfaceHttpOutput.Interceptor
-
getNextInterceptor
public HttpOutput.Interceptor getNextInterceptor()
Deprecated.- Specified by:
getNextInterceptor
in interfaceHttpOutput.Interceptor
- Returns:
- The next Interceptor in the chain or null if this is the last Interceptor in the chain.
-
getScheduler
public Scheduler getScheduler()
Deprecated.
-
useDirectBuffers
public boolean useDirectBuffers()
Deprecated.- Returns:
- true if the HttpChannel can efficiently use direct buffer (typically this means it is not over SSL or a multiplexed protocol)
-
abort
public void abort(Throwable failure)
Deprecated.If a write or similar operation to this channel fails, then this method should be called.The standard implementation calls
HttpTransport.abort(Throwable)
.- Parameters:
failure
- the failure that caused the abort.
-
-