dbi services Blog
Welcome to the dbi services Blog! This blog focuses on IT infrastructure - featuring news, troubleshooting, and tips & tricks. It covers database, middleware, and OS technologies such as Oracle, Microsoft SQL Server & SharePoint, Documentum, MySQL, PostgreSQL, Sybase, Unix/Linux, etc. The dbi services blog represents the view of our consultants, not necessarily that of dbi services. Feel free to comment on the postings!
Oracle Java EE 7 - an overview
After announcing the availability of Oracle Java Enterprise Edition 7 (Java EE 7 or JEE7), Oracle organized a web event for the launch, covering topics such as the new features and the java community as well as showing some examples of the new APIs. This blog post summarizes some key points of this event.
The show was driven by the following Oracle presenters:
- Hasan Rizvi, Executive Vice President, Oracle Fusion Middleware and Java, Oracle
- Cameron Purdy, Vice President, Development, Oracle
- Arun Gupta - Java EE & GlassFish Evangelist, Oracle
- Linda DeMichiel, Specification Lead for Java Platform, Enterprise Edition 7, Oracle
This event was split in three main parts:
- Business keynote: State of Java from Oracle and partners
- Technical keynote: Technical overview from Oracle and Java EE community
- Technical breakouts: 15 sessions featuring demos and details about each new JSR, delivered by the specification leads, this part will not be covered here
First, a global introduction to Java was made with its different platform such as SE, FX, EE and Embedded. Then, the presentation focused on EE7. The key points of this webcast were the simplified use of the APIs, the cross platform goals, and the improved security handling. As you know, a desktop or client java application is less vulnerable than a web application running on an application server. So Oracle guarantees quality and security for this new release.
The presenter also evoked the 18 Java EE6 compliant application servers and mentioned that glassfish was the first and favorite Java EE7 compliant application server. The new EE7 release is available in NetBeans with a lot of templates and useful tools that help the developers gain time. A “pre-version” is also available through Eclipse.
Cameron and Arun expressed their gratitude to the Java User Groups for their great help in developing more efficient APIs and solving issues.
Then, things got serious with the new features. Here are the top ten of Java EE 7 features:
- WebSocket client/server endpoints
- Batch Applications
- JSON processing
- Concurrency utilities
- Simplified JMS API
- @Transactional and @TransactionScoped
- JAX-RS client API
- Default Resources
- More annotated POJOs
- Faces Flow
I will not describe all of them here; you will find extensive documentation on the Oracle website. I will only present the most prominent features such as WebSocket, JSON and Batch applications.
This is a key technology for HTML5 support. It provides a highly efficient communication between client and server websocket endpoints on a single bidirectional and full-duplex TCP connection. It works with simple annotations affixed to POJOs, no descriptors needed! You can specify the URL at which the endpoint is published directly in the annotation. The method that needs to be invoked is marked with an @OnMessage.
As you can see in the example above, you can easily specify lifecycles methods such as onOpen and onClose that are called respectively when a client connects or disconnects.
This is a key technology for data transfer within HTML5 applications. Java EE7 adds new APIs allowing the parsing and generating of JSON objects and text. There are two type of APIs: Streaming APIs, which are low level and thus highly efficient, similar to StAX. These APIs generate events to retrieve the next values. The second API type is more convenient, easy to use and high level. It is similar to DOM, reading the whole JSON text in memory and allowing cross-reference objects. So it is not recommended to use this API type to read just a part of the JSON text.
The batch API features the execution of batch jobs. It is suited for non-interactive, bulk-oriented, and long-running tasks. It can be executed sequentially, in parallel or by decisions with item-oriented or task-oriented style.
A job is defined using Job Specification Language, represented here by an XML file. This file contains steps, each of which contain three elements.
- A reader
- A processor
- A writer
These elements are beans and respectively implement ItemReader, ItemProcessor and ItemWriter interfaces. The reader retrieves the inputs of the step, the processor is in charge of the business processing, and the writer represents the output. The job represents the entire batch process and it is managed by a JobOperator, which can access a JobRepository holding jobs information of currently running or finished jobs.
During this webcast, Oracle tried to emphasize that the company listens to the community and the customers in order to provide accurate, efficient, and easy-to-use APIs for the new JEE generation. By designating Glassfish as the first JEE7 application server, Oracle seems to be sending a strong message to the open source community.