Package org.glassfish.grizzly.config

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


            if (httpService == null || httpService instanceof ContainerMapper) {
                super.service(request, response);
            } else {
//                req.setNote(MAPPED_ADAPTER, adapter);

                ContextRootInfo contextRootInfo = null;
                if (mappingData.context != null && mappingData.context instanceof ContextRootInfo) {
                    contextRootInfo = (ContextRootInfo) mappingData.context;
                }

                if (contextRootInfo == null) {
                    httpService.service(request, response);
                } else {
                    ClassLoader cl = null;
                    if (contextRootInfo.getContainer() instanceof ApplicationContainer) {
                        cl = ((ApplicationContainer) contextRootInfo.getContainer()).getClassLoader();
                    }
                   
                    dispatch(httpService, cl, request, response);
                }
            }


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

                    for (String pattern : sniffer.getURLPatterns()) {
                        for (String host : grizzlyService.hosts) {
                            mapper.addWrapper(host, ROOT, pattern, c,
                                    "*.jsp".equals(pattern) || "*.jspx".equals(pattern));
 

        // 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;

//        }

        mapMultipleAdapter = true;
//        String ctx = getContextPath(contextRoot);
//        String wrapper = getWrapperPath(ctx, contextRoot);
        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);

//        String ctx = getContextPath(contextRoot);
//        String wrapper = getWrapperPath(ctx, contextRoot);
        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();
            }

     */
    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);
    }

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

                    for (String pattern : sniffer.getURLPatterns()) {
                        for (String host : grizzlyService.hosts) {
                            mapper.addWrapper(host, ROOT, pattern, c,
                                    "*.jsp".equals(pattern) || "*.jspx".equals(pattern));
 

        // 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;

//        }

        mapMultipleAdapter = true;
//        String ctx = getContextPath(contextRoot);
//        String wrapper = getWrapperPath(ctx, contextRoot);
        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);

//        String ctx = getContextPath(contextRoot);
//        String wrapper = getWrapperPath(ctx, contextRoot);
        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();
            }

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.