Class EagerContentHandler

All Implemented Interfaces:
Handler, Handler.Container, Handler.Singleton, Request.Handler, Container, Destroyable, Dumpable, Dumpable.DumpableContainer, LifeCycle, Invocable
Direct Known Subclasses:
DelayedHandler

public class EagerContentHandler extends ConditionalHandler.ElseNext

A ConditionalHandler that can eagerly load content asynchronously before calling the next handler. Typically this handler is deployed before an application that uses blocking IO to read the request body. By using this handler, such an application can be run in a way so that it never (or seldom) blocks on request content. This gives many of the benefits of asynchronous IO without the need to write an asynchronous application.

The handler uses the configured EagerContentHandler.FormContentLoaderFactory instances to eagerly load specific content types. By default, this handler supports eager loading of:

FormFields
Loaded and parsed in full by the EagerContentHandler.FormContentLoaderFactory
MultiPartFormData
Loaded and parsed in full by the EagerContentHandler.MultiPartContentLoaderFactory
Content.Chunk
Retained by the EagerContentHandler.RetainedContentLoaderFactory