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
FieldsModifier and TypeFieldDescriptionstatic final RejectedRouteHandlerARejectedRouteHandlerthat does nothing for a problematicRoute.static final RejectedRouteHandlerstatic final RejectedRouteHandlerARejectedRouteHandlerthat logs a warning message for a problematicRoute. -
Method Summary
Modifier and TypeMethodDescriptionvoidhandleDuplicateRoute(VirtualHost virtualHost, Route route, Route existingRoute) Invoked when a user attempts to bind anHttpServiceat theRoutethat conflicts with an existingRoute.
-
Field Details
-
DISABLED
ARejectedRouteHandlerthat does nothing for a problematicRoute. -
WARN
ARejectedRouteHandlerthat 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 anHttpServiceat theRoutethat conflicts with an existingRoute.- Parameters:
virtualHost- theVirtualHostwhere theRoutebelongs toroute- theRoutebeing addedexistingRoute- the existingRoute- Throws:
Exception
-