Package org.atmosphere.cpr

Examples of org.atmosphere.cpr.AtmosphereServlet$Action


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


        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

        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

     *
     * @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

    @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

    }

    private void initAtmosphereServlet(ServletContext servletContext) {
        log.debug("Registering Atmosphere Servlet");
        ServletRegistration.Dynamic atmosphereServlet =
                servletContext.addServlet("atmosphereServlet", new AtmosphereServlet());

        atmosphereServlet.setAsyncSupported(true);
        atmosphereServlet.setInitParameter("org.atmosphere.cpr.packages", "fr.ippon.tatami.web.atmosphere");
        atmosphereServlet.setInitParameter("org.atmosphere.cpr.broadcasterCacheClass", UUIDBroadcasterCache.class.getName());
        atmosphereServlet.setInitParameter("org.atmosphere.cpr.broadcaster.shareableThreadPool", "true");
View Full Code Here

      }
         
        httpPort = Integer.parseInt(bundleContext.getProperty("jetty.port"));
        httpSSLPort = Integer.parseInt(bundleContext.getProperty("jetty.port.ssl"));
       
        Servlet atmosphereServlet = new AtmosphereServlet();

      httpService.registerServlet(REST_SERVLET_ALIAS,
        atmosphereServlet, getJerseyServletParams(), createHttpContext());

       logger.info("Started REST API at /rest");
View Full Code Here

         
        httpPort = Integer.parseInt(bundleContext.getProperty("jetty.port"));
        httpSSLPort = Integer.parseInt(bundleContext.getProperty("jetty.port.ssl"));

      httpService.registerServlet(CV_SERVLET_ALIAS,
        new AtmosphereServlet(), getJerseyServletParams(), createHttpContext());

       logger.info("Started Cometvisu API at "+CV_SERVLET_ALIAS);

       if (discoveryService != null) {
         discoveryService.registerService(getDefaultServiceDescription());
View Full Code Here

    protected Object handleGetEffect()
    {
        // Effect is mapped to action, not activity
        // We return the first action encountered in the activity
        Action effectAction = null;
        Activity effect = this.metaObject.getEffect();
        if (effect != null)
        {
            Collection nodes = effect.getNodes();
            for (Iterator nodesIt = nodes.iterator(); nodesIt.hasNext() && effectAction == null;)
View Full Code Here

            }

            Iterator actions = transactionRequest.getAllActions().iterator();

            while (actions.hasNext()) {
                Action a = (Action) actions.next();

                switch (a.getType()) {
                case Action.DELETE:
                    elems[3].getType().encode(elems[3], a, output, hints);

                    break;
View Full Code Here

TOP

Related Classes of org.atmosphere.cpr.AtmosphereServlet$Action

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.