Examples of AtmosphereAdapter


Examples of org.atmosphere.grizzly.AtmosphereAdapter


    @Override
    public Adapter configureAdapter(SelectorThread st) {
        st.setDisplayConfiguration(true);
        AtmosphereAdapter adapter = new AtmosphereAdapter();
        adapter.addRootFolder(st.getWebAppRootPath());
        adapter.setHandleStaticResources(true);

        // be sure to convert Windows path
        applicationLoc = applicationLoc.replaceAll("\\\\", "/");

        String warName = "";

        if (applicationLoc.lastIndexOf("/") > -1) {
            warName = applicationLoc.substring(applicationLoc.lastIndexOf("/"), applicationLoc.lastIndexOf("."));
        } else {
            warName = applicationLoc;
        }

        adapter.setContextPath(warName);

        if (!servletPath.startsWith("/")) {
            servletPath = "/" + servletPath;
        }
        adapter.setServletPath(WebAppAdapter.getServletPath(servletPath));

        adapter.setResourcePackage(resourcesPackage);
        return adapter;
    }
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.