Monday Jun 03, 2013

An Overview of the Java API for WebSocket

The Java API for WebSocket (JSR 356) is one of the key parts of Java EE 7. It allows Java developers to write Java HTML5/WebSocket applications with a simple, fluent, high-level API, both on the client and the server-side. With the official Java EE 7 launch looming there's already a flurry of great articles on topics like JSR 356.

In a recent OTN article, Johan Vos provides an overview of the Java API for WebSocket. He covers WebSockets, the JSR, the programming model, API details through code examples and advanced features. The article is a great starting point to learning WebSocket. You could also take a look at my slide deck below.

You are of course encouraged to take a look at the official specification (the JSR recently had it's final release). At fifty some pages, it is pretty digestible.

Friday May 31, 2013

Java EE@JeeConf 2013

JeeConf 2013 was held in historic Kiev on May 24-25. JeeConf is the most significant Java conference in the Ukraine. The conference attracted a bevy of local and international speakers including Venkat Subramaniam, Yakov Fain, Talip Ozturk, Jacek Laskowski, Mohamed Taman and Sander Mak. Topics included Java SE, NoSQL, cloud, HTML5/JavaScript, Arquillian and of course Java EE.

I delivered two very well attended talks - my talk on Java EE 7 (our flagship talk) and a talk on using NoSQL databases in Java EE. More details on the sessions and JeeConf, including the slide decks and code, posted on my personal blog.

Thursday May 30, 2013

Non-Blocking I/O in Servlet 3.1

Servlet 3.1 is a relatively minor release slated for Java EE 7. However, the Java EE foundational API still contains some very important changes, especially for folks building on the Servlet API. One such feature is the newly added support for non-blocking I/O to empower low-latency, high throughput applications, protocols and web frameworks.

Servlet 3.1 co-spec lead Shing Wai Chan shows you how in a recent code example driven post. Incidentally, Servlet 3.1 recently had it's final release. You can now check out the official specification yourself. You can also try the API out with a GlassFish promoted build.

Wednesday May 29, 2013

An Overview of JASPIC 1.1 Changes in Java EE 7

It's easy to focus on just the big ticket changes in Java EE 7 such as WebSocket, JSON-P, JMS 2, JAX-RS 2, Java Batch, Concurrency Utilities and so on but there's actually a lot more going on pretty much across the board. One such set of important but easy to overlook changes are in JASPIC 1.1 (JSR 196).

In a very well written blog post, Arjan Tijms goes over the changes. He talks about the context/motivation for each change along with the technical details and sample code. He also references the very handy change log for JASPIC 1.1. It's a great read if you are interested in Java EE security.

Tuesday May 28, 2013

Nigel Deakin on JMS 2

The 131st episode of the Java Spotlight podcast features an interview with JMS 2 specification lead Nigel Deakin. JMS 2 is one of the key parts of the Java EE 7 platform and a long awaited update to the very popular API. Nigel talks with Roger Brinkley about the motivation for the JSR, the simplified API, the new features, MDB alignment, portable JMS resource definitions in Java EE 7, current status of the JSR as well as what's in the future.

You can listen to the full podcast here. It's really a great starting point for learning about JMS 2. You can certainly give the official specification a read yourself (the API recently had it's final release). At a hundred and fifty some pages, it is not too bad of a read and Nigel does a great job of summarizing the changes towards the beginning of the document in the section titled What is new in JMS 2.0?. You can also try the API out with a GlassFish promoted build.

Thursday May 16, 2013

10 Ways JMS 2 == Less Code

JMS 2 is one of the most significant parts of Java EE 7. One of the principal goals of the JMS 2 API is improving developer productivity by reducing the amount of code to work with JMS by adopting programming paradigms like higher level abstractions, dependency injection, annotations, runtime exceptions, the builder pattern and intelligent defaults. In a brief write-up JMS 2 specification lead Nigel Deakin highlights these changes by demonstrating ten concrete ways the JMS 2 API means less code as compared with JMS 1.1.

JMS 2 recently passed it's final approval ballot. You could check out the proposed final draft yourself. At 150 some pages, it is a pretty digestible specification. You can also try the API out with a GlassFish promoted build.

Friday May 10, 2013

Java EE@JavaOne Russia 2013

JavaOne Russia 2013 was held at the Crocus Expo Center in Moscow on April 23-24. The conference was a resounding success with a great vibe, excellent technical content and numerous world class speakers. Some notable speakers included Werner Keil, Joonas Lehtinen, Heather VanCura, Paul Bakker, Bert Ertman, Talip Ozturk, Anil Gaur, Geertjan Wielenga, Arun Gupta, Jim Weaver, Stephen Chin and David Delabassee. Topics covered included the JCP/JUGs, Java SE 8, Java EE 7, HTML 5/WebSocket, JSF, JMS 2, JAX-RS 2, Java EE Concurrency, JBatch, JSON-P, NetBeans, MySQL, Vaadin, the Oracle Java Cloud, OpenShift, OSGi, JavaFX and Coherence.

 

 

I delivered the Java EE technical keynote, two technical sessions (one on JSM 2 and the other on JAX-RS 2) and three lighting talks (on Java EE Concurrency, JBatch and JSON-P). I also helped deliver two hands-on-labs (on Java EE 7 and the Java Cloud Service). More details on the sessions and JavaOne Russia 2013, including the slide decks and code, posted on my personal blog.

Thursday May 09, 2013

HTTP Upgrades in Servlet 3.1

Servlet 3.1 is a relatively minor release slated for Java EE 7. However, the Java EE foundational API still contains some very important changes, especially for folks building on the Servlet API. The newly added support for HTTP protocol upgrades is a great example. The upgrade facility has been there since HTTP 1.1, but just hasn't been used that widely. It facilitates building richer protocols on top of HTTP. Under the hood, this is exactly the mechanism that HTML 5 WebSockets use (as you know, we now have excellent support for WebSockets in Java EE via JSR 356). You can most certainly use HTTP protocol upgrades in similarly powerful and innovative ways yourself.

Servlet 3.1 co-spec lead Shing Wai Chan shows you how in his recent code example driven post. Incidentally, Servlet 3.1 recently passed it's final approval ballot. You could check out the proposed final draft yourself.

Wednesday May 08, 2013

Santiago Pericas-Geertsen on JAX-RS 2

The 130th episode of the Java Spotlight podcast features an interview with JAX-RS 2 co-spec lead Santiago Pericas-Geertsen. JAX-RS 2 is one of the key parts of the Java EE 7 platform and a vital update to the very popular API. Santiago talks with Roger Brinkley about the motivation for the JSR, some of the API details such as the client API, asynchronous processing, interceptors/filters, Hypermedia support and content negotiation, current status of the JSR as well as what's in the future.

You can listen to the full podcast here. It's really a great starting point for learning about JAX-RS 2. You can certainly give the proposed final draft a read yourself (the API recently passed it's final approval ballot). At ninety some pages, it is not too bad of a read. You can also try the API out with a GlassFish promoted build.

Tuesday Apr 30, 2013

Anthony Lai on Java EE Concurrency Utilities

The 129th episode of the Java Spotlight podcast features an interview with Java EE Concurrency Utilities (JSR 236) spec lead Anthony Lai. As you may be aware, the Java EE Concurrency Utilities has been a long awaited and very important foundational API, especially for third party vendors to more easily integrate with the underlying application server runtime. Anthony talks with Roger Brinkley about the motivation for the JSR, it's long history, some of the API details, current status and the future.

You can listen to the full podcast here. It's really a great starting point for learning about the Java EE Concurrency Utilities. You can certainly give the proposed final draft a read yourself (the API recently passed it's final approval ballot). At fifty some pages, it is a very digestible specification. You can also try the API out with a GlassFish promoted build.

Thursday Apr 18, 2013

The Java Update, Applets/Web Start and GlassFish

By now, most of us know about the Java SE security vulnerability that affects primarily Java Applets. You might be relieved to know that the latest Java update, Java 7 Update 21, looks to fix that vulnerability. Java EE expert group member and key community figure Markus Eisele did an awesome job explaining the details and providing further context.

Although the security vulnerabilities definitely do not affect server-side applications (the ones running on GlassFish), GlassFish has had support for launching Java EE application clients using Java Web Start. If you don't know what Web Start is, you are hardly alone - it's even less prevalent than Applets these days. The java.com site does a pretty good job of explaining Web Start. The Java update affects Web Start too, so if you are using it, you'll need to be aware of the changes. Oracle's Tim Quinn explains what you need to watch out for.

Wednesday Apr 17, 2013

An Overview of EJB 3.2

Java EE 7 includes a minor update of the EJB API with EJB 3.2 (JSR 345). For those of you keeping track of the EJB spec the past few years, EJB 3.0 and EJB 3.1 were pretty big releases, so this release is really more about pruning dead branches, some tidying up and minor fixes. In a brief blog entry, long time EJB fan, JBoss AS committer and JavaRanch Sherriff Jaikiran Pai does a great job of overviewing the changes in EJB 3.2. He talks about the pruning of EJB 2.1 CMP/ EJB 2.1 BMP/EJB 2.1 client views/EJB QL/JAX-RPC, local asynchronous session bean invocations and non-persistent EJB Timer Service in EJB Lite, TimerService.getAllTimer(), the ability to disable passivation of stateful beans and much more.

If the article whets your appetite to learn more about EJB 3.2, you could download the actual proposed final draft and give it a read. With the removal of a lot of the older cruft, the core specification is now about 450 pages - which is still nothing to sneeze at but much better than it has been in the past.

Tuesday Apr 16, 2013

Maven projects with GlassFish 4.0 Embedded Plugin

 

Some specifications related to Java EE 7 already became Final. One example is the JavaServer Faces 2.2 (JSR 344). But you don't have to wait for the release of Java EE 7 and the final version of GlassFish 4.0, which is the reference implementation, to try all the new stuff. I've blogged about Maven and its integration with GlassFish Embedded in a way where you can, with just few steps, create a Java EE 7 and then run GlassFish Embedded 4.0 without installing it.

The good thing about this setup is that you will be "ready-to-go" as soon the Final version is released. All you will need to do will be to update the dependency and the plugin version inside your POM xml file. Now stop reading and start coding: go to my blog post "GlassFish 4 beta and Maven Embedded Plugin" and get started with Java EE 7 TO-DAY!

Wednesday Apr 10, 2013

Java EE 7 Maven Archetype

For those of us doing Java EE development with Maven (which by my own account as a former consultant is pretty much all Java EE/GlassFish adopters), Archetypes can be a great productivity boost, especially while getting started. You will be pleased to know that there is already a Java EE 7 Maven Archetype out there in the https://nexus.codehaus.org/content/repositories/snapshots/ repository (courtesy of GlassFish of course).

You can use it directly from the Maven command-line like so:

mvn -DarchetypeGroupId=org.codehaus.mojo.archetypes 
    -DarchetypeArtifactId=webapp-javaee7 
    -DarchetypeVersion=0.3-SNAPSHOT 
    -DarchetypeRepository=https://nexus.codehaus.org/content/repositories/snapshots/ 
    -DgroupId=your_group_id 
    -DartifactId=your_artifact_id 
    -Dversion=your_version
    -Dpackage=your_package
    -Darchetype.interactive=false 
    --batch-mode 
    --update-snapshots 
    archetype:generate

If you prefer NetBeans, you can do that too. Just define a new repository with the URL https://nexus.codehaus.org/content/repositories/snapshots/ under "Maven Repositories" on the "Services" tab. Then proceed to "New Project -> Maven -> Project from Archetype" and enter "webapp-javaee7" into the search box. Select the 0.1-SNAPSHOT and click "Finish".

Either way, once the project is generated, you can of course tweak the POM and source code to meet your needs. It should be pretty straightforward - give me a shout if you need help getting started. Happy hacking!

Tuesday Apr 09, 2013

JMS 2, Bean Validation 1.1, JBatch, JSON-P Go Final!

Java EE 7 is almost to the finish line! The first slew of Java EE 7 JSRs have successfully passed their Final Approval Ballots and are now final. JMS 2 (JSR 343), Bean Validation 1.1 (JSR 349), JBatch (JSR 352), and JSON-P (JSR 353) all passed with near unanimous support from the JCP Executive Committee. Please join me in congratulating spec leads Nigel Deakin of Oracle, Emmanuel Bernard of Red Hat, Chris Vignola of IBM, and Jitendra Kotamraju of Oracle on the fruition of all their hard, often thankless work.

We expect more Java EE 7 JSRs to follow suit shortly, so stay tuned. This is a great time to read the final specs and start experimenting with them in the GlassFish 4 builds.