Tuesday Dec 31, 2013

Using Socket.IO with the Java API for WebSocket?

If you have looked into how to use WebSocket with emergent JavaScript frameworks like Angular, Backbone, Ember or Knockout, it's very likely you've come across Socket.IO. While Socket.IO is a very useful library, it is mostly geared towards Node.js and significantly different from plain WebSockets as defined by the IETF and the W3C as well as the JCP/JSR 356 (the Java API for WebSocket). However, with a little bit of hacking, it's not too hard to get the Socket.IO client library to work with the Java API for WebSocket.

Lee Chuk Munn from the Advanced Technology Applications Practice for the National University of Singapore, Institute of Systems Science describes the problem space well and shows you how to hack a basic solution. Chuk plans on working on a framework that builds a more complete solution to marry Socket.IO and JSR 356. He used GlassFish 4 and NetBeans 7.4 for his work. Does this inspire you to hack a framework on top of JSR 356, join Chuk in his efforts or contribute to the GlassFish community in the New Year :-)?

Friday Dec 27, 2013

A Realistic JSF 2.2 Faces Flows Example

While very basic introductory examples are invaluable in explaining a new API, they can fail to do a rich API justice - especially from the perspective of more experienced developers. For some of us, looking at a slightly more involved, realistic example can shed far better light on the practical value proposition for a technology.

Faces Flows are one of the best hidden gems in Java EE 7. Standardized in JSF 2.2 they enable web application flow state management in an elegant, declarative fashion. In an excellent blog post, Liferay Faces project lead and JSF 2.2 expert group member Neil Griffin takes an in-depth look at Faces Flows. He explains the motivation for the feature, contrasts it with the Java EE 6/CDI 1.0 conversation scope and demonstrates the feature using a very realistic use case and non-trivial example code. There's also the video of Ed Burns and Roger Kitain's JavaOne 2013 JSF 2.2 talk on Parleys.com:

The source slide deck for the talk - titled JSF 2.2 New Features in Context is posted on the JavaOne Content Catalog. Make sure to check out the other great JavaOne 2013 sessions on Parleys.com too!

Tuesday Dec 24, 2013

Season's Greetings and Happy New Year from the GlassFish/Java EE Team!

On behalf of the GlassFish and Java EE team at Oracle I wish you and your family Season's Greetings and a very Happy New Year!

As you know this has been quite an eventful year for us - especially with the release of Java EE 7 and GlassFish 4 as well as the now ongoing survey effort to help drive the agenda for Java EE 8 and GlassFish 5, not to mention efforts like the revamped GlassFish.org community site. We are ever thankful for your support and we hope to continue to try our best to serve your interests, perhaps against what many would consider pretty tall odds.

In the coming year, we will look forward to working harder than ever in engaging you through the Java EE open standard, the GlassFish code base, Adopt a JSR, Java EE Blue Print projects and this humble community blog among many other existing and upcoming efforts.

Thanks and best wishes once again. We hope to see you next year!

Monday Dec 23, 2013

Java EE@Oredev 2013

Oredev 2013 was held on 4-8 November in Malmo Sweden. This was my second time at the largest IT conference in the Scania region - I had been there in 2010 as an independent. This year it attracted a decent section of the Java crowd including my fellow Oracle colleagues Brian Goetz, Geertjan Wielenga, Attila Szegedi, Aleksey Shipilev, Cecilia Borg, Marcus Hirt and Tomas Nilsson as well as independent Adam Bien. Topics covered included Java EE, mobile, DDD, agile, HTML5, cloud, Java SE, OpenJDK, JavaScript and NoSQL.

I delivered a full day workshop on Java EE 7 and a technical talk on JAX-RS 2, both of which went well. More details on the sessions and Oredev, including the slide deck and code, posted on my personal blog.

Friday Dec 20, 2013

Server Sent Events (SSE) in Glassfish/Jersey

As you know, HTTP is a stateless protocol. For most use cases in the enterprise, the statelessness of HTTP is a huge boon for scalability - a benefit that is also extended to REST. However, there is a certain class of arguably emerging use cases for which the stateless nature of HTTP is actually a scalability challenge. These use cases require the bidirectional, full-duplex, asynchronous characteristics of stateful protocols such as TCP. Examples include chat-like online collaboration, stock-ticker like command-control/monitoring, online gaming and the like. WebSocket (and the Java API for WebSocket newly included in Java EE 7 :-)) is ideal for these cases. Between the seemingly diametric opposites of plain HTTP and WebSocket, there's also Server Sent Events (SSE). SSE is aimed at yet another scenario - a steam of events generated by the server and consumed passively by the client. Although not standardized in JAX-RS 2/Java EE 7, Jersey/GlassFish includes support for SSE.

In an very detailed blog post, Rahman Usta of the Istanbul JUG explains SSE and demonstrates a non-trivial use of the Jersey/GlassFish support for SSE.

Thursday Dec 19, 2013

JSF 2.2 New Features in Context

"If the smaller characters are well-written, the whole world of the film becomes enriched. 
It's not the size of the thing, but the detail." 
(Brendan Gleeson)

A lot of airtime is spent on the APIs that were added to Java EE 7 (e.g. WebSocket) and APIs that went through a major revision (e.g. JMS 2.0 or JAX-RS 2.0). But let's not forget that a lot of others APIs have been revised in Java EE 7 and this sometime implies new features, new capabilities.

In this JavaOne session, Roger Kitain and Edward Burns who are both Specification Leads for JavaServer Faces, explains in details some of the important features that were added to JSF 2.2 (e.g. Faces Flow, HTML5-friendly markup, Resource library contracts). Those new features are explained in detail and demonstrated in the context of a self-contained sample application. Ed and Roger also shows that JSF is still relevant in today's enterprise software stack, they finally compares the benefits of upgrading to JSF 2.2 against opting for a totally new architecture.

Wednesday Dec 18, 2013

Want to Work on WebSocket/Tyrus? Oracle is Hiring!

The WebSocket team at Oracle is looking for another key contributor! If you want to become part of the dynamic, high-profile team that is working on the industry leading Java API for WebSocket (JSR 356) reference implementation Tyrus and related open standards, projects and products like Java EE, GlassFish and WebLogic, this is the time to update your resume/CV and share it with us. The job is based in Prague, Czech Republic.

The formal details of the job are on LinkedIn.

If you are interested and have any questions, please feel free to post your questions here, get in touch with the Tyrus team or drop an email directly to pavel dot bucek at oracle dot com.

Tuesday Dec 17, 2013

Project Avatar : TSA, SSE, ... and Java EE 8!

"I wouldn't say 'Avatar' changed my life, but it definitely changed my career." Stephen Lang

Project Avatar provides a back-end JavaScript services that support REST, WebSockets and Server-Sent Events. In addition, it also offers an optional client side framework that assumes very minor JavaScript knowledge. 

Markus Eisele recently wrote a nice article (see "Project Avatar - What's in it for Java EE 8?"). Project Avatar is leveraging some of the Java EE technologies (eg. WebSocket, REST). And has pointed in the article, some additional technologies (e.g. SSE (*)) and architecture choices (i.e. Thin Server Architecture, expanded use of JavaScript) are also used. Those technologies and architecture choices might be considered, in one form or another, for inclusion in Java EE 8. So, Project Avatar gives you the ability to check and test those technical choices and the Java EE 8 Survey (Part 1) gives you the opportunity to provides us feedback on those (and not just on those!). 

So if you have some time to spare during the Christmas break, please give a look at Project Avatar and provide us feedback for Java EE 8. The collective feedback, yours included, will help to change and shape the next revision of the Java EE Platform!

(*) Server-sent Events (SSE)  are currently supported by Jersey but they are not part of the Java EE 7 specification. 

Monday Dec 16, 2013

Java EE@Pune JUG

Pune JUG organized a meetup at the Symbiosis Institute of Computer Studies and Research (SICRSR) college campus on December 14th. Led by Harshad Oak (Java Champion and organizer of the IndicThreads conference), Pune JUG is the oldest JUG in India and boasts a vibrant developer community. This month's meetup was focused on the Java EE 7 platform and the ecosystem that is building up around it. The meeting was led by Oracle India's own Vijay Nair. Vijay is a good friend and a lead developer with Oracle's FLEXCUBE development group in India. Among many other things like evangelizing Java EE at local Java user groups and conferences, Vijay contributes heavily to the Cargo Tracker Java EE Blue Prints project in his spare time.

 The event saw an attendance of close to around 100 people with a lot of demos/code and high quality interactions with the audience. Vijay presented no less than three sessions at the meetup:

  • JavaEE.Next(): Java EE 7, 8, and Beyond - This is basically our flagship talk at the moment. The talk briefly covers the evolution of the platform, details the changes in Java EE 7 and invites developers to help shape Java EE 8. The materials for the talk is posted here.
  • Android and iOS Development with Java EE 7 - This was a fairly popular technical session at JavaOne San Francisco 2013 led by me, Ryan Cuprak and Bala Muthuvarathan. The session demonstrates how Java EE 7 acts as an excellent platform for building "headless" back-ends for native mobile applications with REST and WebSocket as the client communication protocols. The materials for the talk is posted here. The code is posted on GitHub.
  • Using NoSQL with JPA, EclipseLink and Java EE - This session explores the current state of the NoSQL landscape and how Java EE can be utilized to access NoSQL solutions such as Oracle NoSQL, MongoDB, Cassandra, etc utilizing JPA style facades or plain CDI. The materials for the talk is posted here. The code is posted on GitHub.

Overall, this was a very positive experience with developers giving two thumbs way up to the Java EE 7 platform!

Wednesday Dec 11, 2013

'Come and Play! with Java EE 7' in London!

"The French and the British are such good enemies that they can't resist being friends."
(Peter Ustinov)

Our friends of the London GlassFish User Group are planning their next event on the 9th of January 2014. For that occasion, Antonio Goncalves (Paris JUG, Devoxx France, Java EE EG Member, author...) will dare to cross the Channel to talk on Java EE 7.


'Come and Play! with Java EE 7'

As you know, Java EE is old-fashioned, heavyweight, cumbersome, and made mostly of boilerplate code. Who would develop a modern Web application with such a technological stack? Who would start a heavy application server, deploy some EJBs, and wait ages for integration tests to run - only to end up with an ugly Web page?

If you like HTML5 front ends with responsive design, sexy graphical components, manageable REST interfaces, easy asynchronous processing, reliable messaging, and transactional databases, come to this session to see two developers writing and testing a real Java EE 7 Web application within 1 hour.

More info can be found here.

Tuesday Dec 10, 2013

Want to work on JMS? We are hiring!

The Oracle Java Messaging Group is looking for a talent to help build enterprise-class standards-compliant messaging infrastructure (such as WebLogic JMS) and engineered messaging implementations. This job position is based either in Santa Clara, CA or Liberty Corner, NJ.

If you are interested, check out this job posting for more details.

Monday Dec 09, 2013

We need your help! Java EE 8 Survey - Part 1

As we start to plan for the next revision of the Java EE Platform (Java EE 8), we would like to get input from the community on the relative importance of some of the features that we might add.

Please participate in the Java EE 8 features survey to let your voice be heard and help us prepare the future of Java EE, it shouldn't take you more than a few minutes! 

This is the first part of a two-part survey. We'll be announcing part 2 in the beginning of the new year. So again, if you want to help shaping the future of Java EE, please participate in the survey.

Wednesday Dec 04, 2013

Java Mission Control with Marcus and Markus

"You can observe a lot by just watching." (Yogi Berra

Java Mission Control (JMC) is a JVM production time profiling and diagnostics suite of tools. The suite includes tools to observe, manage, profile, and eliminate memory leaks in Java applications and due to its very low overhead, JMC is particularly fitted to detect performance issues in applications running in production. 

JMC is based on runtime performance analyzing capabilities that were originally only available in JRockit. It is the fruit of the work Oracle has done over the last years to convergence its 2 JVMs (HotSpot and JRockit) into a single one. Starting with the 7u40 release, JMC is available in the regular HotSpot distribution. It is a commercial feature that can be used freely in development as per the standard Oracle Binary Code License (BCL).

Marcus Hirt (@hirt) of the Java Mission Control team wrote a nice introduction on Java Mission Control. Markus Eisele (@myfear) wrote another post showing how to quickly configure JMC and JFR with GlassFish 4.

Monday Dec 02, 2013

Asynchronous session beans and 'Concurrency Utilities for Java EE API'

"It's true hard work never killed anybody, but I figure, why take the chance?" (Ronald Reagan)

There are different approaches to obtain an asynchronous behaviour within a Java EE application, this post cover 2 of them.

Asynchronous Session Beans, added in EJB 3.1 (Java EE 6), is one possible solution. The @Asynchronous annotation is used to decorate session bean methods that should be invoked asynchronously. When such a bean method is invoked, the control returns to the invoking client before the container dispatches the invocation to an instance of the bean. This allows the client to continue processing in parallel while that particular session bean method performs its operations. In EJB 3.2 (Java EE 7), Asynchronous Session Beans are now part of EJB Lite and as such are even more widely available.

Another approach is the use the new Concurrency Utilities for Java EE API (JSR 236) which was added to Java EE 7. The goal of this JSR is simple, i.e. it allows to safely use some of Java SE's java.util.concurrent.* features within a Java EE context. So if you are familiar with some the JSR166 features (e.g. ExecutorServices), you can now re-use the same features in a managed Java EE environment.

Mohamed Sanaulla recently wrote different posts explaining how to use the different JSR 236 Managed Objects : ManagedExecutorService, ManagedScheduledExecutorService and ManagedThreadFactory.