Examples of NameVirtualHostHandler


Examples of io.undertow.server.handlers.NameVirtualHostHandler

     * @param hostHandler The host handler
     * @param hostnames   The host names
     * @return A new virtual host handler
     */
    public static NameVirtualHostHandler virtualHost(final HttpHandler hostHandler, String... hostnames) {
        NameVirtualHostHandler handler = new NameVirtualHostHandler();
        for (String host : hostnames) {
            handler.addHost(host, hostHandler);
        }
        return handler;
    }
View Full Code Here

Examples of io.undertow.server.handlers.NameVirtualHostHandler

    @Test
    public void complexSSLTestCase() throws IOException, GeneralSecurityException, URISyntaxException, InterruptedException {
        final PathHandler pathHandler = new PathHandler();
        File rootPath = new File(FileHandlerTestCase.class.getResource("page.html").toURI()).getParentFile();

        final NameVirtualHostHandler virtualHostHandler = new NameVirtualHostHandler();
        HttpHandler root = virtualHostHandler;
        root = new SimpleErrorPageHandler(root);
        root = new CanonicalPathHandler(root);

        virtualHostHandler.addHost("default-host", pathHandler);
        virtualHostHandler.setDefaultHandler(pathHandler);

        pathHandler.addPrefixPath("/", new ResourceHandler()
                .setResourceManager(new FileResourceManager(rootPath, 10485760))
                .setDirectoryListingEnabled(true));
View Full Code Here

Examples of io.undertow.server.handlers.NameVirtualHostHandler

     * Creates a new virtual host handler
     *
     * @return A new virtual host handler
     */
    public static NameVirtualHostHandler virtualHost() {
        return new NameVirtualHostHandler();
    }
View Full Code Here

Examples of io.undertow.server.handlers.NameVirtualHostHandler

     * Creates a new virtual host handler using the provided default handler
     *
     * @return A new virtual host handler
     */
    public static NameVirtualHostHandler virtualHost(final HttpHandler defaultHandler) {
        return new NameVirtualHostHandler().setDefaultHandler(defaultHandler);
    }
View Full Code Here

Examples of io.undertow.server.handlers.NameVirtualHostHandler

     * @param hostHandler The host handler
     * @param hostnames   The host names
     * @return A new virtual host handler
     */
    public static NameVirtualHostHandler virtualHost(final HttpHandler hostHandler, String... hostnames) {
        NameVirtualHostHandler handler = new NameVirtualHostHandler();
        for (String host : hostnames) {
            handler.addHost(host, hostHandler);
        }
        return handler;
    }
View Full Code Here

Examples of io.undertow.server.handlers.NameVirtualHostHandler

        worker = null;
        xnio = null;
    }

    private HttpHandler buildHandlerChain() {
        final NameVirtualHostHandler virtualHostHandler = new NameVirtualHostHandler();
        for (VirtualHost host : hosts) {
            final PathHandler paths = new PathHandler();
            paths.addPath("/", host.defaultHandler);
            for (final Map.Entry<String, HttpHandler> entry : host.handlers.entrySet()) {
                paths.addPath(entry.getKey(), entry.getValue());
            }
            HttpHandler handler = paths;
            for (HandlerWrapper wrapper : host.wrappers) {
                handler = wrapper.wrap(handler);
            }
            handler = addLoginConfig(handler, host.loginConfig);
            if (host.defaultHost) {
                virtualHostHandler.setDefaultHandler(handler);
            }
            for (String hostName : host.hostNames) {
                virtualHostHandler.addHost(hostName, handler);
            }

        }

        HttpHandler root = virtualHostHandler;
View Full Code Here

Examples of io.undertow.server.handlers.NameVirtualHostHandler

     * Creates a new virtual host handler
     *
     * @return A new virtual host handler
     */
    public static NameVirtualHostHandler virtualHost() {
        return new NameVirtualHostHandler();
    }
View Full Code Here

Examples of io.undertow.server.handlers.NameVirtualHostHandler

     * Creates a new virtual host handler using the provided default handler
     *
     * @return A new virtual host handler
     */
    public static NameVirtualHostHandler virtualHost(final HttpHandler defaultHandler) {
        return new NameVirtualHostHandler().setDefaultHandler(defaultHandler);
    }
View Full Code Here

Examples of io.undertow.server.handlers.NameVirtualHostHandler

     * @param hostHandler The host handler
     * @param hostnames   The host names
     * @return A new virtual host handler
     */
    public static NameVirtualHostHandler virtualHost(final HttpHandler hostHandler, String... hostnames) {
        NameVirtualHostHandler handler = new NameVirtualHostHandler();
        for (String host : hostnames) {
            handler.addHost(host, hostHandler);
        }
        return handler;
    }
View Full Code Here

Examples of io.undertow.server.handlers.NameVirtualHostHandler

     * Creates a new virtual host handler
     *
     * @return A new virtual host handler
     */
    public static NameVirtualHostHandler virtualHost() {
        return new NameVirtualHostHandler();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.