Package org.glassfish.grizzly.config

Examples of org.glassfish.grizzly.config.ContextRootInfo$Holder


        try {
            mapper.setDefaultHostName(defaultHostName);
            mapper.addHost(defaultHostName, new String[]{}, null);
            mapper.addContext(defaultHostName, ROOT,
                    new ContextRootInfo(this, null),
                    new String[]{"index.html", "index.htm"}, null);
            // Container deployed have the right to override the default setting.
            Mapper.setAllowReplacement(true);
        } finally {
            mapperLock.writeLock().unlock();


                HttpHandler httpHandler;
                if (match) {
                    httpHandler = grizzlyService.getHabitat().getService(SnifferAdapter.class);
                    ((SnifferAdapter) httpHandler).initialize(sniffer, this);
                    ContextRootInfo c = new ContextRootInfo(httpHandler, null);

                    mapperLock.readLock().unlock();
                    mapperLock.writeLock().lock();
                    try {
                        for (String pattern : sniffer.getURLPatterns()) {

        // the request is targetted to the CoyoteAdapter.
        mapper.map(req.getRequest().serverName(), decodedURI, mappingData);

        updatePaths(req, mappingData);

        ContextRootInfo contextRootInfo;
        if (mappingData.context != null && (mappingData.context instanceof ContextRootInfo
                || mappingData.wrapper instanceof ContextRootInfo)) {
            if (mappingData.wrapper != null) {
                contextRootInfo = (ContextRootInfo) mappingData.wrapper;
            } else {
                contextRootInfo = (ContextRootInfo) mappingData.context;
            }
            return contextRootInfo.getHttpHandler();
        } else if (mappingData.context != null &&
                "com.sun.enterprise.web.WebModule".equals(mappingData.context.getClass().getName())) {
            return ((V3Mapper) mapper).getHttpHandler();
        }
        return null;

            LOGGER.log(Level.FINE, "MAPPER({0}) REGISTER contextRoot: {1} adapter: {2} container: {3} port: {4}",
                    new Object[]{this, contextRoot, httpService, container, String.valueOf(listener.getPort())});
        }

        mapMultipleAdapter = true;
        ContextRootInfo c = new ContextRootInfo(httpService, container);
        for (String host : vs) {
            mapper.addContext(host, contextRoot, c, new String[0], null);
            /*
            if (adapter instanceof StaticResourcesAdapter) {
            mapper.addWrapper(host, ctx, wrapper, c);

        mapMultipleAdapter = true;
        final String contextRoot = endpoint.getContextRoot();
        final Collection<String> vs = endpoint.getVirtualServers();
       
        ContextRootInfo c = new ContextRootInfo(new ContextRootInfo.Holder() {
            @Override
            public HttpHandler getHttpHandler() {
                return endpoint.getEndpointHandler();
            }

                    logger.log(Level.FINE, "", e);
                }
            }

            if (md.context != null && md.context instanceof ContextRootInfo) {
                ContextRootInfo r = (ContextRootInfo) md.context;
                if (!(r.getHttpHandler() instanceof ContainerMapper)){
                    new BindException("Port " + port + " is already used by Container: "
                            + r.getHttpHandler() +
                            " and will not get started.").printStackTrace();
                    return null;
                }
            }
        }

                    logger.log(Level.FINE, "", e);
                }
            }

            if (md.context != null && md.context instanceof ContextRootInfo) {
                ContextRootInfo r = (ContextRootInfo) md.context;
                if (!(r.getHttpHandler() instanceof ContainerMapper)){
                    new BindException("Port " + port + " is already used by Container: "
                            + r.getHttpHandler() +
                            " and will not get started.").printStackTrace();
                    return null;
                }
            }
        }

                    logger.log(Level.FINE, "", e);
                }
            }

            if (md.context != null && md.context instanceof ContextRootInfo) {
                ContextRootInfo r = (ContextRootInfo) md.context;
                if (!(r.getHttpHandler() instanceof ContainerMapper)){
                    new BindException("Port " + port + " is already used by Container: "
                            + r.getHttpHandler() +
                            " and will not get started.").printStackTrace();
                    return null;
                }
            }
        }

                    logger.log(Level.FINE, "", e);
                }
            }

            if (md.context != null && md.context instanceof ContextRootInfo) {
                ContextRootInfo r = (ContextRootInfo) md.context;
                if (!(r.getHttpHandler() instanceof ContainerMapper)){
                    new BindException("Port " + port + " is already used by Container: "
                            + r.getHttpHandler() +
                            " and will not get started.").printStackTrace();
                    return null;
                }
            }
        }

     */
    protected synchronized void configureMapper() {
        mapper.setDefaultHostName(defaultHostName);
        mapper.addHost(defaultHostName, new String[]{}, null);
        mapper.addContext(defaultHostName, ROOT,
                new ContextRootInfo(this, null),
                new String[]{"index.html", "index.htm"}, null);
        // Container deployed have the right to override the default setting.
        Mapper.setAllowReplacement(true);
    }

TOP

Related Classes of org.glassfish.grizzly.config.ContextRootInfo$Holder

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.