Interface RouteGroup

All Known Subinterfaces:
Application

public interface RouteGroup
Registers routes and middleware for a scope: the whole application, or a group of routes under a path prefix created with group(String, Consumer).

For a matched route the chain runs global middleware, then the middleware of each enclosing group from the outermost to the innermost, then the route's own middleware, then the handler. use(Middleware) applies to every route of its scope wherever it is called; middleware of one scope run in use order. Startup composes each route's chain once.

Lifecycle. Registration is allowed only before the application starts and fails with IllegalStateException afterwards. A group passed to a group callback is valid only until that callback returns. Registration is thread-safe; middleware and handlers are shared across concurrent requests and must be thread-safe.