Java Specification Watch

Last Java EE 7 JSR filed with WebSocket API

Chris Mayer

JSR 356 just about made the cut for Java EE 7 specifications, bringing a Java API for WebSocket. More details within.

Oracle has completed the list of JSRs set for Java EE 7, with
the proposed inclusion of a Java API for WebSocket to become part
of the Enterprise version for good.

Spec lead, Oracle’s Danny Coward filed the request which
“will define a standard API for creating WebSocket
applications.” The reason for this proposal seems fairly obvious,
given the popularity of WebSocket and a growing number within the
Java community desiring to be able to use it within the platform to
create web application. Coward details this in his documentation,

There is a wide range of web applications that rely
on timely updates from a central server like stock tickers, live
maps, chat applications, collaborative online tools and multiplayer
web-based games. WebSocket offers solution to the problems of
latency, scalability and performance associated with HTTP based
solutions like polling, long-polling and

There is a lot of interest in the Java developer
community in creating web applications for the Java platform that
utilize WebSocket. Given that the definition of WebSocket protocol
is a proposed standard, and that the major web browsers either
support, or plan to support it in their next major release, the
time is right for a standard Java API for

JSR 356 will create bi-directional WebSocket Java components,
whilst support for initiating and intercepting WebSocket events
will be provided. The JSR also claims that it will be able to
create and consume WebSocket messagers and also have the ability to
define WebSocket protocols and content models for an application.
There will also be specifications regarding how WebSocket will work
within Java EE’s security model.

Coward says that this will be achieved through “a mix of APIs
together with Java annotations to make it flexible and easy to use”
like other Java APIs. The primary goal is to make this gold
standard server-based, but with a secondary scenario in place,
which would enable the API to aid Java-client of WebSocket
applications residing on a server. Many servers such as Glassfish
and web client Grizzly already have WebSocket capability, but it
makes sense to make it available to all using Java EE.

The original intention is to purely include this in Java EE 7,
but there are also early plans to at least consider an option for
Java SE. The Review Ballot is scheduled to start on 21 Feb,
2012 where the SE/EE Executive Committee will ponder over the

For further details on JSR 356, take a look at
it in full. We think a standardised WebSocket API, that makes it
easy to create portable code is long overdue for the community, but
we’d love to hear your thoughts on the matter. We anxiously await
the Executive Committee’s decision.

comments powered by Disqus