Package com.jetdrone.vertx.yoke

Examples of com.jetdrone.vertx.yoke.Middleware


    @Test
    public void testDash() {
        final Yoke yoke = new Yoke(this);
        yoke.use(new com.jetdrone.vertx.yoke.middleware.Router() {{
            get("/api-stable", new Middleware() {
                @Override
                public void handle(@NotNull final YokeRequest request, @NotNull final Handler<Object> next) {
                    request.response().end("OK");
                }
            });
View Full Code Here


        init(yoke, mount, headBindings);
        init(yoke, mount, traceBindings);
        init(yoke, mount, connectBindings);

        for (String key : paramProcessors.keySet()) {
            final Middleware m = paramProcessors.get(key);
            if (m instanceof AbstractMiddleware && !((AbstractMiddleware) m).isInitialized()) {
                ((AbstractMiddleware) paramProcessors.get(key)).init(yoke, mount);
            }
        }
View Full Code Here

     * Specify a middleware that will be called for a matching HTTP GET
     * @param pattern The simple pattern
     * @param handler The middleware to call
     */
    public Router get(@NotNull final String pattern, @NotNull final Handler<YokeRequest> handler) {
        return get(pattern, new Middleware() {
            @Override
            public void handle(@NotNull YokeRequest request, @NotNull Handler<Object> next) {
                handler.handle(request);
            }
        });
View Full Code Here

     * Specify a middleware that will be called for a matching HTTP PUT
     * @param pattern The simple pattern
     * @param handler The middleware to call
     */
    public Router put(@NotNull final String pattern, @NotNull final Handler<YokeRequest> handler) {
        return put(pattern, new Middleware() {
            @Override
            public void handle(@NotNull YokeRequest request, @NotNull Handler<Object> next) {
                handler.handle(request);
            }
        });
View Full Code Here

     * Specify a middleware that will be called for a matching HTTP POST
     * @param pattern The simple pattern
     * @param handler The middleware to call
     */
    public Router post(@NotNull final String pattern, @NotNull final Handler<YokeRequest> handler) {
        return post(pattern, new Middleware() {
            @Override
            public void handle(@NotNull YokeRequest request, @NotNull Handler<Object> next) {
                handler.handle(request);
            }
        });
View Full Code Here

     * Specify a middleware that will be called for a matching HTTP DELETE
     * @param pattern The simple pattern
     * @param handler The middleware to call
     */
    public Router delete(@NotNull final String pattern, @NotNull final Handler<YokeRequest> handler) {
        return delete(pattern, new Middleware() {
            @Override
            public void handle(@NotNull YokeRequest request, @NotNull Handler<Object> next) {
                handler.handle(request);
            }
        });
View Full Code Here

     * Specify a middleware that will be called for a matching HTTP OPTIONS
     * @param pattern The simple pattern
     * @param handler The middleware to call
     */
    public Router options(@NotNull final String pattern, @NotNull final Handler<YokeRequest> handler) {
        return options(pattern, new Middleware() {
            @Override
            public void handle(@NotNull YokeRequest request, @NotNull Handler<Object> next) {
                handler.handle(request);
            }
        });
View Full Code Here

     * Specify a middleware that will be called for a matching HTTP HEAD
     * @param pattern The simple pattern
     * @param handler The middleware to call
     */
    public Router head(@NotNull final String pattern, @NotNull final Handler<YokeRequest> handler) {
        return head(pattern, new Middleware() {
            @Override
            public void handle(@NotNull YokeRequest request, @NotNull Handler<Object> next) {
                handler.handle(request);
            }
        });
View Full Code Here

     * Specify a middleware that will be called for a matching HTTP TRACE
     * @param pattern The simple pattern
     * @param handler The middleware to call
     */
    public Router trace(@NotNull final String pattern, @NotNull final Handler<YokeRequest> handler) {
        return trace(pattern, new Middleware() {
            @Override
            public void handle(@NotNull YokeRequest request, @NotNull Handler<Object> next) {
                handler.handle(request);
            }
        });
View Full Code Here

     * Specify a middleware that will be called for a matching HTTP CONNECT
     * @param pattern The simple pattern
     * @param handler The middleware to call
     */
    public Router connect(@NotNull final String pattern, @NotNull final Handler<YokeRequest> handler) {
        return connect(pattern, new Middleware() {
            @Override
            public void handle(@NotNull YokeRequest request, @NotNull Handler<Object> next) {
                handler.handle(request);
            }
        });
View Full Code Here

TOP

Related Classes of com.jetdrone.vertx.yoke.Middleware

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.