Monday Apr 29, 2013

JSR 356, Java API for WebSocket

A new article, now up on otn/java, by Java Champion Johan Vos, titled “JSR 356, Java API for WebSocket,” shows developers how to integrate WebSockets into their applications. JSR 356, part of the Java EE 7 platform, specifies the API that Java developers can use when they want to integrate WebSockets into their applications on both on the Java server and client side. The API is highly flexible, and frees developers to write WebSocket-based applications independent of the underlying WebSocket implementation, thus preventing vendor lock in. It also allows for more choice in libraries and application servers. Web clients or native clients leveraging any WebSocket implementation can more easily communicate with a Java back end.

As part of the Java EE 7 standard, all Java EE 7-compliant application servers will have an implementation of the WebSocket protocol that adheres to JSR 356. Vos explains:

“Once they are established, WebSocket client and server peers are symmetrical. The difference between a client API and a server API is, therefore, minimal. JSR 356 defines a Java client API as well, which is a subset of the full API required in Java EE 7….

The Java API for WebSocket is very powerful, because it allows any Java object to be sent or received as a WebSocket message.

Basically, there are three different types of messages:

* Text-based messages
* Binary messages
* Pong messages, which are about the WebSocket connection itself

When using the interface-driven model, each session can register at most one MessageHandler for each of these three different types of messages.

When using the annotation-driven model, for each different type of message, one @onMessage annotated method is allowed. The allowed parameters for specifying the message content in the annotated methods are dependent on the type of the message.”

Check out the article here and learn how to integrate WebSockets into your applications.

Open API Hackathon: Win A Trip to JavaOne San Francisco and more!

Orange Labs is running a contest for the next cool app powered by Java, in association with City of Warsaw and with investment partner IQ Partners.

The Grand Prize is an invitation to Oracle OpenWorld 2013 & JavaOne 2013 w San Francisco – hotel, airfare, and admission included! Three first place prizes are internships at Orange Labs. And the best business-oriented application creator IQ Partners SA will help to create own business (great funds are provided!).

The contest is open to any one with a good idea for an application. The application may use resources from the Orange network like location of devices, presence, device or subscriber information, billing or charging, form City Warsaw like P&R location or Veturilo Location. Contestants are encouraged to use other external resources such as weather, finance, health, etc to make their apps compelling and useful.


See registration and details at www.openmiddleware.pl

Hurry!

Registration closes on June 3rd. All registrations will be judged and finalists will be announced at websitewww.openmiddleware.pl.

Learn More at geecon

Attendees at geecon in Krakow, May 15-17 can get more details at these sessions:

Open API Hackathon introductory talk on "Building Mobile Apps Using Network Assets"
by Douglas Tait
16th May 14:40

Discussion panel on "Using the Network to Build Compelling Applications"

16th May 16:00 

About

Insider News from the Java Team at Oracle!

duke
javeone logo
Links


Search

Archives
« April 2013 »
SunMonTueWedThuFriSat
 
1
5
6
7
9
11
13
14
17
19
20
21
23
24
26
27
28
    
       
Today