Home > Uncategorized > Atmosphere 0.1-ALPHA2 released with support for any WebServer (WebSphere,WLS, etc.), and Servlet 3.0 Async

Atmosphere 0.1-ALPHA2 released with support for any WebServer (WebSphere,WLS, etc.), and Servlet 3.0 Async

Second release (thanks for the feedback so far!), this time with support for any WebServer and the few one that support the Servlet 3.0 Async API.

IMG_2439.JPG

What’s new since our last release? First, if the WebServer you deploy on support the Servlet 3.0 Async specification, the Atmosphere runtime will detect it and will run using those API. Note that your AtmosphereHandler doesn’t have to use the new API to keep portability with other WebServer that aren’t yet supporting those API. Second, if the WebServer you deploy on doesn’t support Comet, the Atmosphere runtime will emulate Comet support by optimally blocking threads when needed. So it means GlassFish v1, Jetty 4/5, Tomcat4/5, BEA’s WLS, WebSphere etc. can now be used with Atmosphere. Finally, the Broadcaster now support custom thread pool (ExecutorService), which you can configure from your AtmosphereHandler:

    public AtmosphereEvent
            onMessage(AtmosphereEvent event) throws IOException {
        HttpServletRequest req = event.getRequest();
        HttpServletResponse res = event.getResponse();

        event.getBroadcaster().setExecutorService(
                    Executors.newCachedThreadPool());
        if (event.isResuming()) {
            String script = BEGIN_SCRIPT_TAG + "window.parent.app.listen();\n" + END_SCRIPT_TAG;

            res.getWriter().write(script);
            res.getWriter().flush();
        } else {
            res.getWriter().write(event.getMessage().toString());
            res.getWriter().flush();
        }
        return event;
    }

Using a thread pool when broadcasting messages can save your life and greatly improve scalability of your application!

Ready to write your first AtmosphereHandler? Download the latest release from here. As usual, feedback appreciated by either sending your questions to users@atmosphere.dev.java.net or by tweeting us!

var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl.” : “http://www.”);
document.write(unescape(“%3Cscript src='” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));

var pageTracker = _gat._getTracker(“UA-3111670-3”);
pageTracker._initData();
pageTracker._trackPageview();

technorati:

Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: