In this book, we will learn how to develop applications on the JBoss Application Server Release 7, which marks a giant leap from previous application server releases. The new application server features a truly modular, blazingly fast container that can be managed either as a standalone process or as part of a domain of servers.
The focus of this book is on application development; therefore, we will need at first to gather all resources required for delivering our applications. More in detail, in this chapter we will cover the following topics:
Java EE (formerly called J2EE) embraces a standard set of technologies for server-side Java development. Java EE technologies include servlets, Java Server Pages (JSPs), Java Server Faces (JSF), Enterprise JavaBeans (EJBs), Context Dependency Injection (CDI), Java Messaging Service (JMS), Java Persistence API (JPA), Java API for XML Web Services (JAX-WS), and Java API for RESTful Web Services (JAX-RS), among others.
Several commercial and open source application servers exist that allow developers to run applications compliant with Java EE; JBoss AS is the leading open source solution adopted by developers and, although this is difficult to measure in exact terms, it is likely to be the most widely used application server in the market.
JBoss AS, the most used application server – myth or fact?
We just threw the stone so we cannot avoid discussing it. There is a common belief that JBoss AS is the favorite application server of developers. Actually, there is no empiric way to measure the popularity of open source software; you may be able to guess it from a number of clues such as the number of downloads and the amount of registered users in the community.
Evaluating each product's community statistics can however be misleading and maybe not even be available to all players in this market. Therefore, if we want to try an approximate comparison, let's move to a neutral field where the world's most used software—Google—rules. A one-minute search on Google trends that includes as search keywords the other big players (Oracle WebLogic, IBM WebSphere, and the open source GlassFish application server) reveals that JBoss AS has the highest trend for 2012 at the time of writing. For more information on this, visit http://www.google.com/trends/?q=jboss,oracle+weblogic,+websphere,glassfish&ctab=0&geo=all&date=2012&sort=0. We will get similar results if we query for 2011.
Another popular instrument of Google is Adwords ; it is used to count the search keywords on a national/worldwide basis. Adwords reveals that JBoss accounts for 1.220.000 monthly searches on Google while WebSphere stops at 1.000.000, Oracle WebLogic stays at 823.000, and Glassfish is around 368.000.
So, although these numbers do not provide the last word on our question (nor do they speak about the quality of the product), they are a good indicator of the developer's sentiment. A word to the wise is enough!
As with all application servers compliant with Java EE, JBoss ships with all the required libraries to allow us to develop and deploy Java applications that comply with Java EE specifications.
Java EE 6, includes several improvements and additions to the specification. The following sections list the major improvements to the specification that are of interest to enterprise application developers.
Java EE 6 includes a new version of JSF. JSF 2.0 includes the following new notable features:
EJB 3.1 was designed around the concept of ease of development for users. Now designing an EJB application is much easier and less error-prone than in the past. Some enhancements provided with this application are as follows:
Finally, Enterprise JavaBeans can now be packaged inside a Web ARchive (WAR) file. This feature greatly simplifies EJB packaging, as in the past an Enterprise ARchive (EAR) file was needed to package web functionality and EJB functionality into a single module.
JPA was introduced as a standard part of Java EE in Version 5 of the specification. JPA was intended to replace entity beans as the standard object-relational mapping framework for Java EE. JPA adopted ideas from third-party object-relational frameworks such as Hibernate and JDO and made them part of the standard.
JPA 2.0 improves on JPA 1.0 in a number of areas:
@ElementCollection
and @OrderColumn
annotationsContexts and Dependency Injection (CDI) (JSR 299) defines a set of services for the Java EE environment that makes applications much easier to develop. CDI leverages a simpler integration between the Web (JSF) and business logic (EJB) tiers, resulting in a significantly simplified programming model for web-based applications; it also provides a programming model suitable for rapid development of simple, data-driven applications. This is a domain where Java EE has been perceived as overly complex in the past.
Java Servlets API 3.0 provides easier web application development with enhanced annotations and integrated Web 2.0 programming model support, security enhancements, asynchronous support, pluggability, simplified configuration, and other improvements.
Java EE 6 has adopted JAX-RS as an official part of the Java EE specification. JAX-RS is a Java API for developing RESTful web services. A RESTful web service exposes a set of resources that identify the targets of the interaction with its clients. Resources are identified by URIs; they provide a global addressing space for resource and service discovery.
18.191.176.228