Package com.linecorp.armeria.server
Interface RejectedRouteHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A handler that is invoked when a
ServerBuilder
rejects to bind an HttpService
at
a certain Route
. For example, the following code will trigger this handler:
ServerBuilder sb = Server.builder();
sb.service("/hello", serviceA);
sb.service("/hello", serviceB); // Tried to bind at the same path again.
sb.build();
-
Field Summary
Modifier and TypeFieldDescriptionstatic final RejectedRouteHandler
ARejectedRouteHandler
that does nothing for a problematicRoute
.static final RejectedRouteHandler
static final RejectedRouteHandler
ARejectedRouteHandler
that logs a warning message for a problematicRoute
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
handleDuplicateRoute
(VirtualHost virtualHost, Route route, Route existingRoute) Invoked when a user attempts to bind anHttpService
at theRoute
that conflicts with an existingRoute
.
-
Field Details
-
DISABLED
ARejectedRouteHandler
that does nothing for a problematicRoute
. -
WARN
ARejectedRouteHandler
that logs a warning message for a problematicRoute
. -
FAIL
-
-
Method Details
-
handleDuplicateRoute
void handleDuplicateRoute(VirtualHost virtualHost, Route route, Route existingRoute) throws Exception Invoked when a user attempts to bind anHttpService
at theRoute
that conflicts with an existingRoute
.- Parameters:
virtualHost
- theVirtualHost
where theRoute
belongs toroute
- theRoute
being addedexistingRoute
- the existingRoute
- Throws:
Exception
-