Class EventsHandler

java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
All Implemented Interfaces:
Handler, Handler.Container, Handler.Singleton, Request.Handler, org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.Dumpable.DumpableContainer, org.eclipse.jetty.util.component.LifeCycle, org.eclipse.jetty.util.thread.Invocable
Direct Known Subclasses:
LatencyRecordingHandler, StatisticsHandler

public abstract class EventsHandler extends Handler.Wrapper

A Handler.Wrapper that fires events during the processing of the requests.

EventsHandler will emit events for the various phases the server goes through while processing an HTTP request and response.

Subclasses may listen to those events to track timing and/or other values such as request URI, etc.

The events parameters, especially the Request object, may be in a transient state depending on the event, and not all properties/features of the parameters may be available inside a listener method.

It is recommended that the event parameters are not acted upon in the listener methods, or undefined behavior may result. On the other hand, it is legit to store request attributes in one listener method that may be possibly retrieved in another listener method in a later event.

Listener methods are invoked synchronously from the thread that is performing the request processing, and they should not call blocking code (otherwise the request processing will be blocked as well).

The kind of chunk passed to onRequestRead(Request, Content.Chunk) depends on the parent of this handler. For instance, if the parent is the Server, then raw chunks are always passed. If somewhere in the parent chain is the GzipHandler then unzipped chunks are passed.