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.
@FunctionalInterface public interface RejectedRouteHandler
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
Fields Modifier and Type Field Description static RejectedRouteHandler
DISABLED
ARejectedRouteHandler
that does nothing for a problematicRoute
.static RejectedRouteHandler
FAIL
static RejectedRouteHandler
WARN
ARejectedRouteHandler
that logs a warning message for a problematicRoute
. -
Method Summary
Modifier and Type Method Description void
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 ExceptionInvoked 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
-