Package com.jetdrone.vertx.yoke.core

Examples of com.jetdrone.vertx.yoke.core.MountedMiddleware


            // the middleware is extracted from the execution chain into a special placeholder
            // for error handling
            if (m instanceof ErrorMiddleware) {
                errorHandler = m;
            } else {
                MountedMiddleware mm = new MountedMiddleware(route, m);
                middlewareList.add(mm);

                // register on JMX
                try {
                    mbs.registerMBean(new MiddlewareMBean(mm), new ObjectName("com.jetdrone.yoke:type=Middleware@" + hashCode() + ",route=" + ObjectName.quote(route) + ",name=" + m.getClass().getSimpleName() + "@" + m.hashCode()));
View Full Code Here


     *
     * @param route   The route prefix for the middleware
     * @param handler The Handler to add
     */
    public Yoke use(@NotNull String route, final @NotNull Handler<YokeRequest> handler) {
        middlewareList.add(new MountedMiddleware(route, new Middleware() {
            @Override
            public void handle(@NotNull YokeRequest request, @NotNull Handler<Object> next) {
                handler.handle(request);
            }
        }));
View Full Code Here

                    @Override
                    public void handle(Object error) {
                        if (error == null) {
                            currentMiddleware++;
                            if (currentMiddleware < middlewareList.size()) {
                                final MountedMiddleware mountedMiddleware = middlewareList.get(currentMiddleware);

                                if (!mountedMiddleware.enabled) {
                                    // the middleware is disabled
                                    handle(null);
                                } else {
View Full Code Here

TOP

Related Classes of com.jetdrone.vertx.yoke.core.MountedMiddleware

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.