Examples of AtmosphereServlet


Examples of org.atmosphere.cpr.AtmosphereServlet

        int port = TestHelper.getEnvVariable("ATMOSPHERE_HTTP_PORT", findFreePort());
        urlTarget = "http://127.0.0.1:" + port + "/invoke";

        server = new Server();
        root = new Context(server, "/", Context.SESSIONS);
        atmoServlet = new AtmosphereServlet();
        configureCometSupport();
        setConnector(port);
        root.addServlet(new ServletHolder(atmoServlet), ROOT);
        server.start();
    }
View Full Code Here

Examples of org.atmosphere.cpr.AtmosphereServlet

        ws = new GrizzlyWebServer(port);
        ServletAdapter sa = new ServletAdapter();
        sa.setProperty("load-on-startup", 0);
        ws.addAsyncFilter(new CometAsyncFilter());
       
        atmoServlet = new AtmosphereServlet();
        //atmoServlet.addInitParameter(CometSupport.MAX_INACTIVE, "20000");
        sa.setServletInstance(atmoServlet);
        configureCometSupport();

        ws.addGrizzlyAdapter(sa,new String[] {ROOT});
View Full Code Here

Examples of org.atmosphere.cpr.AtmosphereServlet

        ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
        context.setContextPath("/");
        server.setHandler(context);

        atmoServlet = new AtmosphereServlet();
        configureCometSupport();
        context.addServlet(new ServletHolder(atmoServlet), "/");
        server.start();
    }
View Full Code Here

Examples of org.atmosphere.cpr.AtmosphereServlet

    @Override
    @BeforeMethod(alwaysRun = true)
    public void setUpGlobal() throws Exception {
        port = TestHelper.getEnvVariable("ATMOSPHERE_HTTP_PORT", findFreePort());
        urlTarget = "http://127.0.0.1:" + port + "/builder/invoke";
        atmoServlet = new AtmosphereServlet();
        atmoServlet.addInitParameter("com.sun.jersey.config.property.packages", this.getClass().getPackage().getName());

        configureCometSupport();
        startServer();
    }
View Full Code Here

Examples of org.atmosphere.cpr.AtmosphereServlet

    @BeforeMethod(alwaysRun = true)
    public void setUpGlobal() throws Exception {
        port = TestHelper.getEnvVariable("ATMOSPHERE_HTTP_PORT", findFreePort());
        urlTarget = getUrlTarget(port);
        atmoServlet = new AtmosphereServlet();
        atmoServlet.addInitParameter("com.sun.jersey.config.property.packages", this.getClass().getPackage().getName());
        atmoServlet.addInitParameter("org.atmosphere.cpr.broadcasterClass", RecyclableBroadcaster.class.getName());

        configureCometSupport();
        startServer();
View Full Code Here

Examples of org.atmosphere.cpr.AtmosphereServlet

    /**
     * Initializes Atmosphere.
     */
    private void initAtmosphereServlet(ServletContext servletContext) {
        log.debug("Registering Atmosphere Servlet");
        AtmosphereServlet servlet = new AtmosphereServlet();
        Field frameworkField = ReflectionUtils.findField(AtmosphereServlet.class, "framework");
        ReflectionUtils.makeAccessible(frameworkField);
        NoAnalyticsAtmosphereFramework atmosphereFramework = new NoAnalyticsAtmosphereFramework();
        ReflectionUtils.setField(frameworkField, servlet, atmosphereFramework);
        ServletRegistration.Dynamic atmosphereServlet =
View Full Code Here

Examples of org.atmosphere.cpr.AtmosphereServlet

        return uri;
    }

    private static String registerCometServlet(ServletHost servletHost) {
        if (ServletFactory.cometServlet == null) {
            ServletFactory.cometServlet = new AtmosphereServlet();
            ServletFactory.cometServlet.addInitParameter(PACKAGE_KEY, HANDLER_PACKAGE);
//            ServletFactory.cometServlet.addInitParameter(FILTERS_KEY, FILTERS);
            String uri = servletHost.addServletMapping(PATH, cometServlet);
            return uri;
        }
View Full Code Here

Examples of org.atmosphere.cpr.AtmosphereServlet

        return null;
    }

    private static void registerJavascriptServlet(ServletHost servletHost) {
        if (ServletFactory.javascriptServlet == null) {
            ServletFactory.javascriptServlet = new AtmosphereServlet();
            ServletFactory.javascriptServlet.addInitParameter(PACKAGE_KEY, JS_PACKAGE);
            servletHost.addServletMapping(JS_PATH, javascriptServlet);
        }
    }
View Full Code Here

Examples of org.atmosphere.cpr.AtmosphereServlet

     *
     * @param servletHost the underlying servlet host
     */
    public static synchronized void registerServlet(final ServletHost servletHost) {
        if (ServletFactory.cometServlet == null) {
            ServletFactory.cometServlet = new AtmosphereServlet();
            ServletFactory.cometServlet.addInitParameter(ServletFactory.PACKAGE_KEY, ServletFactory.PACKAGE_VALUE);
            servletHost.addServletMapping(ServletFactory.PATH, ServletFactory.cometServlet);
            // store operations and corresponding endpoint in the ServletContext
            // so that they can be retrieved from inside the web service methods
            final Map<String, RuntimeEndpoint> endpoints = new HashMap<String, RuntimeEndpoint>();
            ServletFactory.cometServlet.getServletContext().setAttribute(ServletFactory.ENDPOINTS_KEY, endpoints);
            final Map<String, Operation> operations = new HashMap<String, Operation>();
            ServletFactory.cometServlet.getServletContext().setAttribute(ServletFactory.OPERATIONS_KEY, operations);
        }
        if (ServletFactory.javascriptServlet == null) {
            ServletFactory.javascriptServlet = new AtmosphereServlet();
            ServletFactory.javascriptServlet.addInitParameter(ServletFactory.PACKAGE_KEY,
                                                              ServletFactory.JS_PACKAGE_VALUE);
            servletHost.addServletMapping(ServletFactory.JS_PATH, ServletFactory.javascriptServlet);
        }
    }
View Full Code Here

Examples of org.atmosphere.cpr.AtmosphereServlet

    @BeforeMethod(alwaysRun = true)
    public void setUpGlobal() throws Exception {
        port = TestHelper.getEnvVariable("ATMOSPHERE_HTTP_PORT", findFreePort());
        urlTarget = getUrlTarget(port);
        atmoServlet = new AtmosphereServlet();
        atmoServlet.framework().addInitParameter("com.sun.jersey.config.property.packages", this.getClass().getPackage().getName());

        configureCometSupport();
        startServer();
    }
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.