You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No built-in way to modify endpoint behavior today. #406 proposes a way to wholesale replace functionality.
What did you want to happen?
Consider a structured aspect approach to enriching/modifying endpoint behavior:
interfaceEndpointAspect<C> {
interfaceFactory {
/** * Returns an {@link Optional} containing a new {@link EndpointAspect} instance for * {@link Endpoint} if this aspect is relevant for the specified endpoint, and empty otherwise. */
<Context> Optional<? extendsEndpointAspect<Context>> create(Endpointendpoint);
}
/** * Invoked prior to the underlying {@link HttpHandler#handle(HttpServerExchange)} call * and returns a context object of type {@code C}. */defaultCbefore(HttpServerExchangeexchange) {
returnnull;
}
/** * Returns true to prevent calling the underlying {@link HttpHandler} implementation. * Defaults to {@code false}. */defaultbooleanhaltCall(Ccontext, HttpServerExchangeexchange) {
returnfalse;
}
/** * Invoked after the underlying {@link HttpHandler#handle(HttpServerExchange)} call, * if the call does not throw, and returns a context object of type {@code C}. */defaultConSuccess(Ccontext, HttpServerExchangeexchange) {
returnnull;
}
/** * Invoked after the underlying {@link HttpHandler#handle(HttpServerExchange)} call, * if the call throws, and returns a context object of type {@code C}. */defaultConThrow(Ccontext, HttpServerExchangeexchange, Exceptione) {
returnnull;
}
/** * Invoked as a completion listener to the the handler call chain. */defaultvoidcompletion(Ccontext, HttpServerExchangeexchange) {}
}
What happened?
No built-in way to modify endpoint behavior today. #406 proposes a way to wholesale replace functionality.
What did you want to happen?
Consider a structured aspect approach to enriching/modifying endpoint behavior:
Which is implemented as:
The text was updated successfully, but these errors were encountered: