Thursday Sep 26, 2013

Session Report: 50 New Features of Java EE 7 in 50 minutes

 by Timothy Beneke

On Tuesday afternoon, noted Java EE authors Arun Gupta and Antonio Goncalves offered a whirlwind tour of new features in “Java EE 7: Fifty New Features of Java EE 7 in 50 Minutes”. Gupta is legendary at Oracle for his hard work and astute grasp of the Java EE platform. His blog offers a wealth of insight into Java EE and other Java matters. He is the author, most recently, of Java EE 7 Essentials published by O’Reilly. Goncalves is one of the most highly regarded writers on EE anywhere and the author of Beginning Java EE 7, published by Apress.

Java EE 7’s new features enhance HTML5 support, increase developer productivity, and further improve how enterprise demands can be met. Developers will write significantly less boilerplate code, have better support for the latest Web applications, and gain access to enhanced scalability and richer, simpler functionality. The session did a stellar job of spelling out the details to a packed house.

With four new components (WebSocket, JSON-P, batch, and concurrency), and three old ones significantly updated (JAX-RS, JMS, and EL), along with other significant changes to the platform, a lot of new functionality has been added.

They divided the new Java EE 7 features into 19 categories and explained an average of two to three features in each category.  Here were the categories:

CDI 1.1 (JSR 346)
Bean Validation 1.1 (JSR 349)
Interceptors 1.2 (JSR 318)
Concurrency utilities 1.0 (JSR 236)
JPA 2.1 (JSR 338)
JTA 1.2 (JSR 907)
EJB 3.2 (JSR 345)
JMS 2.0 (JSR 343)
Servlet 3.1 (JSR 340)
Web Socket 1.0 (JSR 356)
Expression Language 3.0 (JSR 341)
JSF 2.2 (JSR 344)
JAX-RS 2.0 (JSR 339)
JSON-P 1.0 (JSR 353)
Batch 1.0 (JSR 352)
JavaMail 1.5 (JSR 919)
JCA 1.7 (JSR 322)
Java Connector Architecture
Default Resources

Here are just a few of the high points:

CDI 1.1 (JSR 346) enables finer scanning control and the ability to veto the processing of a class or package. Bean Validation 1.1 (JSR 349) allows for method validation and the ability to pre/post conditions on method and constructors. Interceptors 1.2 (JSR 318) focused on the ability to associate an Interceptor associated with a constructor and the ability to prioritize interceptor bindings.

For Concurrency utilities 1.0 (JSR 236), the emphasis was on ManagedExecutor with a focus on:
* User threads in Java EE applications
* The ability to support simple and advance concurrency design patterns
* And to extend Concurrency Utilities API from Java SE (JSR 166y)

Further emphasis in concurrency was on ManagedThreadFactory and DynamicProxy.

Dynamic Proxy:
* Creates dynamic proxy objects, and adds contextual information available for applications running in Java EE environment
* It supports Classloading, JNDI, Security, …

Also covered as part of concurrency: ManagedExecutor
* User threads in Java EE applications
* Support simple and advance concurrency design patterns
* Extend Concurrency Utilities API from Java SE (JSR 166y)
– java.util.concurrent package

In addition: ManagedScheduledExecutor
* Managed version of ScheduledExecutorService
* Submit delayed or periodic tasks

For JPA 2.1 (JSR 338), standardized database schema generation and the ability to define additional indexes in schema generation were emphasized. JTA 1.2 (JSR 907) was praised for its capacity for transaction management on Managed Beans as a CDI interceptor binding; in addition, it offers CDI scope whose lifecycle is scoped to the currently active JTA transaction.

They discussed WebSocket and annotated server endpoint which enables full-duplex bi-directional communication over a single TCP connection.

JSON Builder creates an object model (or an array) in memory by adding elements. JsonParser is an event-based parser that can read JSON data from a stream.

All in all, it was an impressive display of Java SE 7 expertise.

Java EE 7 Essentials by Arun Gupta

Beginning Java EE 7 by Antonio Goncalves

Be sure to check out Parleys.com in early October to listen to the entire session. It's well worth it.

Friday Jul 19, 2013

Java API for JSON Processing: An Introduction to JSON

A new article, now up on otn/java, by Oracle’s Jitandra Kotamraju, titled “Java API for JSON Processing: An Introduction to JSON,” takes a look at how Java API for JSON Processing provides portable APIs to parse, generate, transform and query JSON, also known as JavaScript Object Notation. Kotamraju, a principal member of the technical staff at Oracle, is the JSON Processing specification lead.

JSO, a lightweight, text-based, language-independent data exchange format that is easy to read and write by both humans and machines, can represent two structured types: objects and arrays. Kotamraju, the JSON Processing specification lead, explains that “an object is an unordered collection of zero or more name/value pairs. An array is an ordered sequence of zero or more values. The values can be strings, numbers, booleans, null and these two structured types.”

JSON is frequently used in Ajax applications, configurations, databases, and RESTful web services. JSON is offered as the data exchange format with their RESTful web services by all popular websites.

Kotamraju gets under the hood with both the object model and streaming APIs. He concludes that the API for JSON Processing offers the following capabilities:
* “Parsing input streams into immutable objects or event streams
* Writing event streams or immutable objects to output streams
* Programmatically navigating immutable objects
* Programmatically building immutable objects with builders”

The API forms a base for building data binding, transformation, querying, or other manipulation APIs. JAX-RS 2.0 provides native integration for the Java API for JSON Processing.

Check out the article here.

Monday Apr 08, 2013

Technical Article: Java EE 7 and JAX-RS 2.0

A new article by Java Champion Adam Bien, titled “Java EE 7 and JAX-RS 2.0” is up on otn/java. The article demonstrates how Java EE 7 with JAX-RS 2.0 has several new useful features which further simplify development, and lead to the creation of more sophisticated Java SE/EE RESTful applications.

Using a Java-friendly, but simplistic JAX-RS 2.0 example Bien takes the reader through aspects, request interception, client and configuration issues and much more. He concludes the article as follows:

“Interestingly, JAX-RS does not even require a full-fledged application server. After fulfilling the specified Context Types, a JAX-RS 2.0–compliant API can be anything. However, the combination with EJB 3.2 brings asynchronous processing, pooling (and so throttling), and monitoring. Tight integration with Servlet 3+ comes with efficient asynchronous processing of @Suspended responses through AsyncContext support and CDI runtime brings eventing. Also Bean Validation is well integrated and can be used for validation of resource parameters. Using JAX-RS 2.0 together with other Java EE 7 APIs brings the most convenient (=no configuration) and most productive (=no re-invention) way of exposing objects to remote systems.”

Check out the article here.

Friday Nov 18, 2011

Blog Buzz - Devoxx 2011

Some day I will make it to Devoxx – for now, I’m content to vicariously follow the blogs of attendees and pick up on what’s happening.  I’ve been doing more blog "fishing," looking for the best commentary on 2011 Devoxx. There’s plenty of food for thought – and the ideas are not half-baked.

The bloggers are out in full, offering useful summaries and commentary on Devoxx goings-on.

Constantin Partac, a Java developer and a member of Transylvania JUG, a community from Cluj-Napoca/Romania, offers an excellent summary of the Devoxx keynotes.

Here’s a sample:

“Oracle Opening Keynote and JDK 7, 8, and 9 Presentation
•    Oracle is committed to Java and wants to provide support for it on any device.
•    JSE 7 for Mac will be released next week.
•    Oracle would like Java developers to be involved in JCP, to adopt a JSR and to attend local JUG meetings.
•    JEE 7 will be released next year.
•    JEE 7 is focused on cloud integration, some of the features are already implemented in glassfish 4 development branch.
•    JSE 8 will be release in summer of 2013 due to “enterprise community request” as they can not keep the pace with an 18    month release cycle.
•    The main features included in JSE8 are lambda support, project Jigsaw, new Date/Time API, project Coin++ and adding   support for sensors.

JSE 9 probably will focus on some of these features:
1.    self tuning JVM
2.    improved native language integration
3.    processing enhancement for big data
4.    reification (adding runtime class type info for generic types)
5.    unification of primitive and corresponding object classes
6.    meta-object protocol in order to use type and methods define in other JVM languages
7.    multi-tenancy
8.    JVM resource management”

Thanks Constantin!

Ivan St. Ivanov, of SAP Labs Bulgaria, also commented on the keynotes with a different focus.  He summarizes Henrik Stahl’s look ahead to Java SE 8 and JavaFX 3.0; Cameron Purdy on Java EE and the cloud; celebrated Java Champion Josh Bloch on what’s good and bad about Java; Mark Reinhold’s quick look ahead to Java SE 9; and Brian Goetz on lambdas and default methods in Java SE 8.

Here’s St. Ivanov’s account of Josh Bloch’s comments on the pluses of Java:

“He started with the virtues of the platform. To name a few:

    Tightly specified language primitives and evaluation order – int is always 32 bits and operations are executed always from left  to right, without compilers messing around
    Dynamic linking – when you change a class, you need to recompile and rebuild just the jar that has it and not the whole application
    Syntax  similarity with C/C++ – most existing developers at that time felt like at home
    Object orientations – it was cool at that time as well as functional programming is today
    It was statically typed language – helps in faster runtime, better IDE support, etc.
    No operator overloading – well, I’m not sure why it is good. Scala has it for example and that’s why it is far better for defining DSLs. But I will not argue with Josh.”

It’s worth checking out St. Ivanov’s summary of Bloch’s views on what’s not so great about Java as well.

What's Coming in JAX-RS 2.0

Marek Potociar, Principal Software Engineer at Oracle and currently specification lead of Java EE RESTful web services API (JAX-RS), blogged on his talk about what's coming in JAX-RS 2.0, scheduled for final release in mid-2012.  

Here’s a taste:

“Perhaps the most wanted addition to the JAX-RS is the Client API, that would complete the JAX-RS story, that is currently server-side only. In JAX-RS 2.0 we are adding a completely interface-based and fluent client API that blends nicely in with the existing fluent response builder pattern on the server-side. When we started with the client API, the first proposal contained around 30 classes. Thanks to the feedback from our Expert Group we managed to reduce the number of API classes to 14 (2 of them being exceptions)! The resulting is compact while at the same time we still managed to create an API that reflects the method invocation context flow (e.g. once you decide on the target URI and start setting headers on the request, your IDE will not try to offer you a URI setter in the code completion). This is a subtle but very important usability aspect of an API…”

Obviously, Devoxx is a great Java conference, one that is hitting this year at a time when much is brewing in the platform and beginning to be anticipated.


About

Insider News from the Java Team at Oracle!

duke
javeone logo
Links


Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
2
5
6
7
12
13
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today