@@ -1546,14 +1546,14 @@ default void handle(final Request req, final Response rsp, final Chain chain) th
15461546 }
15471547
15481548 /**
1549- * <h2>before send </h2>
1549+ * <h2>after </h2>
15501550 *
15511551 * Allows for customized response before send it. It will be invoked at the time a response need
15521552 * to be send.
15531553 *
15541554 * <pre>{@code
15551555 * {
1556- * before ("GET", "*", (req, rsp, result) -> {
1556+ * after ("GET", "*", (req, rsp, result) -> {
15571557 * // your code goes here
15581558 * return result;
15591559 * });
@@ -1563,29 +1563,29 @@ default void handle(final Request req, final Response rsp, final Chain chain) th
15631563 * You are allowed to modify the request, response and result objects. The handler returns a
15641564 * {@link Result} which can be the same or an entirely new {@link Result}.
15651565 *
1566- * Please note that the <code>before send </code> handler is just syntax sugar for
1566+ * Please note that the <code>after </code> handler is just syntax sugar for
15671567 * {@link Route.Filter}.
1568- * For example, the <code>before send </code> handler was implemented as:
1568+ * For example, the <code>after </code> handler was implemented as:
15691569 *
15701570 * <pre>{@code
15711571 * {
15721572 * use("GET", "*", (req, rsp, chain) -> {
15731573 * chain.next(req, new Response.Forwarding(rsp) {
15741574 * public void send(Result result) {
1575- * rsp.send(before (req, rsp, result);
1575+ * rsp.send(after (req, rsp, result);
15761576 * }
15771577 * });
15781578 * });
15791579 * }
15801580 * }</pre>
15811581 *
1582- * Due <code>before send </code> is implemented by wrapping the {@link Response} object. A
1583- * <code>before send </code> handler must to be registered before the actual handler you want to
1582+ * Due <code>after </code> is implemented by wrapping the {@link Response} object. A
1583+ * <code>after </code> handler must to be registered before the actual handler you want to
15841584 * intercept.
15851585 *
15861586 * <pre>{@code
15871587 * {
1588- * before ("GET", "/path", (req, rsp, result) -> {
1588+ * after ("GET", "/path", (req, rsp, result) -> {
15891589 * // your code goes here
15901590 * return result;
15911591 * });
@@ -1606,7 +1606,7 @@ default void handle(final Request req, final Response rsp, final Chain chain) th
16061606 * @author edgar
16071607 * @since 1.0.0.CR
16081608 */
1609- interface BeforeSend extends Filter {
1609+ interface After extends Filter {
16101610 @ Override
16111611 default void handle (final Request req , final Response rsp , final Chain chain ) throws Throwable {
16121612 chain .next (req , new Response .Forwarding (rsp ) {
@@ -1632,13 +1632,13 @@ public void send(final Result result) throws Exception {
16321632 }
16331633
16341634 /**
1635- * <h2>after </h2>
1635+ * <h2>complete </h2>
16361636 *
16371637 * Allows for log and cleanup a request. It will be invoked after we send a response.
16381638 *
16391639 * <pre>{@code
16401640 * {
1641- * after ((req, rsp, cause) -> {
1641+ * complete ((req, rsp, cause) -> {
16421642 * // your code goes here
16431643 * });
16441644 * }
@@ -1647,11 +1647,11 @@ public void send(final Result result) throws Exception {
16471647 * You are NOT allowed to modify the request and response objects. The <code>cause</code> is an
16481648 * {@link Optional} with a {@link Throwable} useful to identify problems.
16491649 *
1650- * The goal of the <code>after </code> handler is to probably cleanup request object and log
1650+ * The goal of the <code>complete </code> handler is to probably cleanup request object and log
16511651 * responses.
16521652 *
1653- * Please note that the <code>after </code> handler is just syntax sugar for {@link Route.Filter}.
1654- * For example, the <code>after </code> handler was implemented as:
1653+ * Please note that the <code>complete </code> handler is just syntax sugar for {@link Route.Filter}.
1654+ * For example, the <code>complete </code> handler was implemented as:
16551655 *
16561656 * <pre>{@code
16571657 * {
@@ -1662,18 +1662,18 @@ public void send(final Result result) throws Exception {
16621662 * } catch (Throwable cause) {
16631663 * err = Optional.of(cause);
16641664 * } finally {
1665- * after (req, rsp, err);
1665+ * complete (req, rsp, err);
16661666 * }
16671667 * });
16681668 * }
16691669 * }</pre>
16701670 *
1671- * An <code>after </code> handler must to be registered before the actual handler you want to
1671+ * An <code>complete </code> handler must to be registered before the actual handler you want to
16721672 * intercept.
16731673 *
16741674 * <pre>{@code
16751675 * {
1676- * after ((req, rsp, cause) -> {
1676+ * complete ((req, rsp, cause) -> {
16771677 * // your code goes here
16781678 * });
16791679 *
@@ -1709,7 +1709,7 @@ public void send(final Result result) throws Exception {
17091709 * });
17101710 *
17111711 * // commit/rollback transaction
1712- * after ((req, rsp, cause) -> {
1712+ * complete ((req, rsp, cause) -> {
17131713 * // unbind connection from request
17141714 * try(Connection connection = req.unset("connection").get()) {
17151715 * Transaction trx = connection.getTransaction();
@@ -1732,7 +1732,7 @@ public void send(final Result result) throws Exception {
17321732 * @author edgar
17331733 * @since 1.0.0.CR
17341734 */
1735- interface After extends Filter {
1735+ interface Complete extends Filter {
17361736
17371737 @ Override
17381738 default void handle (final Request req , final Response rsp , final Chain chain ) throws Throwable {
0 commit comments