undertow-io/undertow — pull request #240 by billoneil (2014-08-09 18:42:26+00:00)
Title: Idea for a composite handler which can easily combine various handlers.

Here is an alternate solution I thought of for easily building complex handlers. I got a little carried away with the Java 8 features when I suggested the HandlerBuilder in the mailing list. I think this is actually a lot more readable and more flexible even if it is a bit more boilerplate. I just briefly added a few of the existing http handlers. Not all handlers should be constructed this way but I think it works well for all handlers that are expected to delegate to additional handlers.

This class can easily be extended to add custom handlers.