@FunctionalInterface public interface RejectedRouteHandler
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();
| Modifier and Type | Field and Description |
|---|---|
static RejectedRouteHandler |
DISABLED
A
RejectedRouteHandler that does nothing for a problematic Route. |
static RejectedRouteHandler |
FAIL
|
static RejectedRouteHandler |
WARN
A
RejectedRouteHandler that logs a warning message for a problematic Route. |
| Modifier and Type | Method and Description |
|---|---|
void |
handleDuplicateRoute(VirtualHost virtualHost,
Route route,
Route existingRoute)
Invoked when a user attempts to bind an
HttpService at the Route that conflicts with
an existing Route. |
static final RejectedRouteHandler DISABLED
RejectedRouteHandler that does nothing for a problematic Route.static final RejectedRouteHandler WARN
RejectedRouteHandler that logs a warning message for a problematic Route.static final RejectedRouteHandler FAIL
void handleDuplicateRoute(VirtualHost virtualHost, Route route, Route existingRoute) throws Exception
HttpService at the Route that conflicts with
an existing Route.virtualHost - the VirtualHost where the Route belongs toroute - the Route being addedexistingRoute - the existing RouteExceptionCopyright © 2020 LeanCloud. All rights reserved.