Package io.undertow.server.handlers.cache

Examples of io.undertow.server.handlers.cache.CacheHandler


                    exchange.getResponseHeaders().put(Headers.CONTENT_LENGTH, data.length() + "");
                    exchange.getResponseSender().send(data);
                }
            }
        };
        final CacheHandler cacheHandler = new CacheHandler(new DirectBufferCache(100, 10, 1000), messageHandler);
        DefaultServer.setRootHandler(cacheHandler);
    }
View Full Code Here


        try {
            File rootPath = new File(getClass().getResource("page.html").toURI()).getParentFile();
            final ResourceHandler handler = new ResourceHandler()
                    .setResourceManager(new FileResourceManager(rootPath, 10485760));

            final CacheHandler cacheHandler = new CacheHandler(new DirectBufferCache(1024, 10, 10480), handler);
            final PathHandler path = new PathHandler();
            path.addPrefixPath("/path", cacheHandler);
            final CanonicalPathHandler root = new CanonicalPathHandler();
            root.setNext(path);
            DefaultServer.setRootHandler(root);
View Full Code Here

        root = new FormEncodedDataHandler(root);
        root = new SimpleErrorPageHandler(root);
        //TODO: multipart

        if (cacheSize > 0) {
            root = new CacheHandler(new DirectBufferCache(1024, 1024 * 1024, cacheSize * 1024 * 1024), root);
        }

        return root;
    }
View Full Code Here

        try {
            File rootPath = new File(getClass().getResource("page.html").toURI()).getParentFile();
            final ResourceHandler handler = new ResourceHandler()
                    .setResourceManager(new FileResourceManager(rootPath, 10485760));

            final CacheHandler cacheHandler = new CacheHandler(new DirectBufferCache(1024, 10, 10480), handler);
            final PathHandler path = new PathHandler();
            path.addPrefixPath("/path", cacheHandler);
            final CanonicalPathHandler root = new CanonicalPathHandler();
            root.setNext(path);
            DefaultServer.setRootHandler(root);
View Full Code Here

                    exchange.getResponseHeaders().put(Headers.CONTENT_LENGTH, data.length() + "");
                    exchange.getResponseSender().send(data);
                }
            }
        };
        final CacheHandler cacheHandler = new CacheHandler(new DirectBufferCache(100, 10, 1000), messageHandler);
        DefaultServer.setRootHandler(cacheHandler);
    }
View Full Code Here

TOP

Related Classes of io.undertow.server.handlers.cache.CacheHandler

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.