public class HttpChannelListeners extends java.lang.Object implements HttpChannel.Listener
HttpChannel.Listener that holds a collection of
other HttpChannel.Listener instances that are efficiently
invoked without iteration.AbstractConnector| Modifier and Type | Class and Description |
|---|---|
private static interface |
HttpChannelListeners.NotifyContent |
private static interface |
HttpChannelListeners.NotifyFailure |
private static interface |
HttpChannelListeners.NotifyRequest |
| Constructor and Description |
|---|
HttpChannelListeners(java.util.Collection<HttpChannel.Listener> listeners) |
| Modifier and Type | Method and Description |
|---|---|
private static HttpChannelListeners.NotifyContent |
combine(HttpChannelListeners.NotifyContent first,
HttpChannelListeners.NotifyContent second) |
private static HttpChannelListeners.NotifyFailure |
combine(HttpChannelListeners.NotifyFailure first,
HttpChannelListeners.NotifyFailure second) |
private static HttpChannelListeners.NotifyRequest |
combine(HttpChannelListeners.NotifyRequest first,
HttpChannelListeners.NotifyRequest second) |
void |
onAfterDispatch(Request request)
Invoked just after the application returns from the first invocation.
|
void |
onBeforeDispatch(Request request)
Invoked just before calling the application.
|
void |
onComplete(Request request)
Invoked when the request and response processing are complete.
|
void |
onDispatchFailure(Request request,
java.lang.Throwable failure)
Invoked when the application threw an exception.
|
void |
onRequestBegin(Request request)
Invoked just after the HTTP request line and headers have been parsed.
|
void |
onRequestContent(Request request,
java.nio.ByteBuffer content)
Invoked every time a request content chunk has been parsed, just before
making it available to the application.
|
void |
onRequestContentEnd(Request request)
Invoked when the end of the request content is detected.
|
void |
onRequestEnd(Request request)
Invoked when the request has been fully parsed.
|
void |
onRequestFailure(Request request,
java.lang.Throwable failure)
Invoked when the request processing failed.
|
void |
onRequestTrailers(Request request)
Invoked when the request trailers have been parsed.
|
void |
onResponseBegin(Request request)
Invoked just before the response line is written to the network.
|
void |
onResponseCommit(Request request)
Invoked just after the response is committed (that is, the response
line, headers and possibly some content have been written to the
network).
|
void |
onResponseContent(Request request,
java.nio.ByteBuffer content)
Invoked after a response content chunk has been written to the network.
|
void |
onResponseEnd(Request request)
Invoked when the response has been fully written.
|
void |
onResponseFailure(Request request,
java.lang.Throwable failure)
Invoked when the response processing failed.
|
static final Logger LOG
public static HttpChannel.Listener NOOP
private final HttpChannelListeners.NotifyRequest onRequestBegin
private final HttpChannelListeners.NotifyRequest onBeforeDispatch
private final HttpChannelListeners.NotifyFailure onDispatchFailure
private final HttpChannelListeners.NotifyRequest onAfterDispatch
private final HttpChannelListeners.NotifyContent onRequestContent
private final HttpChannelListeners.NotifyRequest onRequestContentEnd
private final HttpChannelListeners.NotifyRequest onRequestTrailers
private final HttpChannelListeners.NotifyRequest onRequestEnd
private final HttpChannelListeners.NotifyFailure onRequestFailure
private final HttpChannelListeners.NotifyRequest onResponseBegin
private final HttpChannelListeners.NotifyRequest onResponseCommit
private final HttpChannelListeners.NotifyContent onResponseContent
private final HttpChannelListeners.NotifyRequest onResponseEnd
private final HttpChannelListeners.NotifyFailure onResponseFailure
private final HttpChannelListeners.NotifyRequest onComplete
public HttpChannelListeners(java.util.Collection<HttpChannel.Listener> listeners)
public void onRequestBegin(Request request)
HttpChannel.ListeneronRequestBegin in interface HttpChannel.Listenerrequest - the request objectpublic void onBeforeDispatch(Request request)
HttpChannel.ListeneronBeforeDispatch in interface HttpChannel.Listenerrequest - the request objectpublic void onDispatchFailure(Request request, java.lang.Throwable failure)
HttpChannel.ListeneronDispatchFailure in interface HttpChannel.Listenerrequest - the request objectfailure - the exception thrown by the applicationpublic void onAfterDispatch(Request request)
HttpChannel.ListeneronAfterDispatch in interface HttpChannel.Listenerrequest - the request objectpublic void onRequestContent(Request request, java.nio.ByteBuffer content)
HttpChannel.ListeneronRequestContent in interface HttpChannel.Listenerrequest - the request objectcontent - a slice of the request content chunkpublic void onRequestContentEnd(Request request)
HttpChannel.ListeneronRequestContentEnd in interface HttpChannel.Listenerrequest - the request objectpublic void onRequestTrailers(Request request)
HttpChannel.ListeneronRequestTrailers in interface HttpChannel.Listenerrequest - the request objectpublic void onRequestEnd(Request request)
HttpChannel.ListeneronRequestEnd in interface HttpChannel.Listenerrequest - the request objectpublic void onRequestFailure(Request request, java.lang.Throwable failure)
HttpChannel.ListeneronRequestFailure in interface HttpChannel.Listenerrequest - the request objectfailure - the request failurepublic void onResponseBegin(Request request)
HttpChannel.ListeneronResponseBegin in interface HttpChannel.Listenerrequest - the request objectpublic void onResponseCommit(Request request)
HttpChannel.ListeneronResponseCommit in interface HttpChannel.Listenerrequest - the request objectpublic void onResponseContent(Request request, java.nio.ByteBuffer content)
HttpChannel.ListeneronResponseContent in interface HttpChannel.Listenerrequest - the request objectcontent - a slice of the response content chunkpublic void onResponseEnd(Request request)
HttpChannel.ListeneronResponseEnd in interface HttpChannel.Listenerrequest - the request objectpublic void onResponseFailure(Request request, java.lang.Throwable failure)
HttpChannel.ListeneronResponseFailure in interface HttpChannel.Listenerrequest - the request objectfailure - the response failurepublic void onComplete(Request request)
HttpChannel.ListeneronComplete in interface HttpChannel.Listenerrequest - the request objectprivate static HttpChannelListeners.NotifyRequest combine(HttpChannelListeners.NotifyRequest first, HttpChannelListeners.NotifyRequest second)
private static HttpChannelListeners.NotifyFailure combine(HttpChannelListeners.NotifyFailure first, HttpChannelListeners.NotifyFailure second)
private static HttpChannelListeners.NotifyContent combine(HttpChannelListeners.NotifyContent first, HttpChannelListeners.NotifyContent second)