Java EE Platform

The platform, then, is a balance between the three forces, namely the community of the enterprise Java developers, the product providers, and of course the enterprise that must uphold the business models.

The community requires standardization in order that they can easily embrace technology without the fear of vendor lock-in. They also want to be satisfied with a sound investment in the software development for years to come.

The vendors have an interest in selling their products, services, and support to the community of users for years to come. They also want to have a platform that lowers the barriers to compete against other vendors. It is helpful for them that there is a standard to aim for, a testable certification to achieve, in which they can brand their servers.

The specification for the Full Profile edition of Java EE 7 has the following APIs:

Name

Version

Description

JSR

Web

Profile

Batch Process

1.0

Batch Processing (NEW)

352

 

Bean Validation

1.1

Bean Validation framework

349

Y

Common Annotations

1.1

Common Annotations for the Java EE platform

250

Y

CDI

1.1

Contexts and Dependency Injection for Java EE

346

Y

Concurrency Utilities

1.0

Concurrency Utilities for the Java EE platform (NEW)

236

 

DI

1.0

Dependency Injection for Java

330

Y

EL

3.0

Unified Expression Language for configuration of web components and context dependency injection

341

Y

EJB

3.2

Enterprise Java Beans, entity beans and EJB QL

345

Y (EJB Lite)

Interceptors

1.2

Interceptor technology (NEW)

318

Y

JACC

1.4

Java Authorization Contract for Containers

115

 

JASPIC

1.1 M/B

Java Authentication Service Provider Interface for Containers

196

 

JavaMail

1.4

Java Mail API

919

 

JAXB

2.2

Java API for XML Binding

222

 

JAXP

1.4

Java API for XML Parsing

206

 

JAX-RS

2.0

Java API for RESTful Services

339

Y

JAX-WS

1.3

Java API for XML –based Web Services including SOAP and WSDL

224

 

JCA

1.7

Java EE Connector Architecture

322

 

JMS

2.0

Java Message Service

343

 

JPA

2.1

Java Persistence API

338

Y

JSF

2.2

Java Server Faces

344

Y

JSON-P

1.0

JavaScript Serialization Object Notation Protocol

353

Y

JSP

2.3

Java Server Pages

245

Y

Debugging support

1.0

Debugging Support for Other Languages such as Java Server Pages

45

Y

JSTL

1.2

Java Standard Template Library

245

Y

JTA

1.2

Java Transaction API

907

Y

Managed Beans

1.0

Managed Beans 1.1

342

Y

Servlet

3.1

Java Servlet

340

Y

Web Services

1.3

Web services

224

 

Web Services Metadata

2.1

Web services metadata

181

 

WebSocket

1.0

Java API for WebSocket (NEW)

356

Y

There is also a subset of the Java EE 7 product, known as the Web Profile that only handles the web specific Java enterprise APIs. Examples of this sort of product are open source Apache Tomcat from the Apache Software Foundation, Caucho's proprietary Resin, and the ever popular open source embeddable Jetty Server. The Java EE 7 web container products have a much smaller subset of JSRs to implement.

Note

You might have noticed that some of the Java EE APIs were supported already in some web containers, which existed before the profiles were standard in Java EE 6 (December 10, 2009).

Java Persistence, which maps entity beans, or persistence capable objects, to a relational database, is one of the most crucial and important application interfaces. JPA is a tremendous success for the portable object-relation mapping applications that works across the databases and application servers. Your code can move from one vendor's database connection to another. There is always a slight caveat emptor: there is no such thing as 100 percent portability. But without the standard framework, your developers would have to work an awful lot harder than tweaking a few database tables and configuring a different JDBC connection resource.

Portability and the future of the Java SE and EE platforms will be very important for moving your applications to the diverse, but unstandardized, cloud-computing environment. Although cloud computing was dropped from Java EE 7 late in the establishment of the specification, adopting Java EE 7 will help in the mid-term future when there is an official Java enterprise edition for the cloud. It is rather likely that in those modern utility computing environments, prospective business subscribers will welcome the ability to move from one cloud PaaS (Platform as a Service) vendor to another for a technical and/or business reason.

Standards, then, are very important to Java. It means that we can all move along in a positive direction with less fear of the unknown and that, ladies and gentlemen, is good for everybody. The API that your application code depends on is critical to its software lifecycle. Let's move on to the profiles.

Java EE Profiles

The formal definition of a profile is a specialization of a Java Platform Edition that includes zero or more Java Community Process (JCP) specifications (that are not part of the Platform Edition Specification). Java Enterprise Platform Edition defines two profiles, the Full Profile and the Web Profile product.

Java EE Web Profile, to give it its full official name, is the first profile defined by the standards committee, the JCP. The Web Profile defines a small subset of the Java EE components for delivering the web content. It specifically targets the Java web developers who are responsible for delivering the Java web applications.

The Web Profile offers a degree of completeness with its set of APIs. A business developer can write modern web applications that only access, execute, and perform against Web Profile. Most web applications require state-management and transactional demands. Even though a lot of Java Web Applications, written today rely less on direct calls to the Java Servlet API, in most cases they still tend to use a Java Web Framework.

Web Profile

The Web Profile has the following feature set of APIs:

  • Java Servlet API 3.1: This framework provides handling for an HTTP request and response synchronously and now asynchronously
  • Enterprise Java Bean Lite 3.2: This is a less demanding model of service endpoints, where the business logic of the application lives
  • Context and Dependency Injection 1.1: This is a framework for the application that transfers the lifecycle and management of the connected objects to the container
  • Java Server Faces 2.2: This is a component-based web user interface framework
  • Java Transaction API 1.2: This is a framework for two-phase commit transactions
  • Java Persistence 2.1: This is a framework for persisting POJO to a database
  • Web Socket 1.0: This is a new specification for Java to engage the HTML5 WebSocket clients and servers
  • Bean Validation 1.1: This is an upgraded framework to constrain the fields, properties, and methods of the value objects in an application
  • JAX-RS 2.0: This is an upgraded framework for the Java Enterprise applications to handle the RESTful communications
  • JSON-P 1.0: This is a brand new framework for the Java application read-and-write JavaScript Schema Object Notation (JSON) documents

With these small set of requirements, it is not surprising that the Java EE implementation providers find the Web Profile easier to implement.

Tip

Which Web Frameworks and Java EE 7

Usually the biggest question for the Java Enterprise developers in the past has been, what web framework to use? At the time of writing, JSF 2.2 is the only framework that is compatible. The purveyors of the other frameworks, such as Apache Wicket, WebWork, or even Spring MVC must update their services, especially to support the new asynchronous abilities in Java Servlets 3.1 and JAX-RS 2.0.

The way we build web applications in 2013 is also changing, and the author expects some new innovations here in this space. Some applications are going straight to the RESTful applications by passing the older Front Controller and MVC architecture of traditional web frameworks from Java EE 6 or before. In those web applications, the interface is simply a barrage of the AJAX call-and-response calls from the client side, predominantly a single application communicating with a server-side backend.

Enterprise Profile

The Enterprise Full Profile is the complete set of API that matches the Platform Edition specification, which compliant providers must fulfill, in order to be certified as Java EE 7 compliant.

It's worth looking at each component of the platform and spending some time getting acquainted with them. There are an awful lot of individual specifications here and my advice is to use the Web Profile as a guide to getting into the Java EE 7 experience.

The following table is a guide to the key Enterprise services:

Name

Description

JTA

A standard API for demarcating the transactions in either the application or container.

EJB

Enterprise Java Beans are the transactional service endpoints that represent the interface to business logic for a client. They can be stateless, stateful, or singleton instances.

Managed Beans

Managed beans are endpoints with a contextual scope and they are type safe entities. Managed beans are managed by the Context and Dependency Injection container.

JDBC

JDBC is often quoted (wrongly) as Java Database Connectivity, a standard API for connecting to a relational database system. This component is part of the Standard Platform Edition.

JPA

Java Persistence API is the standard framework for the object-relational mapping of the Java objects to a database. JPA provides management of persistence through a persistence context. It allows the application developers to store data as the Java domain object rather than the relational tables. JPA is also available in the Java SE environments.

JMS

Java Message Service is a standard API for receiving and sending messages in a reliable transport, mostly asynchronously. JMS is based on the point-to-point messages and also publish-subscribe messaging. JMS is the basis for the Enterprise application integration in Java.

JNDI

Java Naming and Directory Interface is a standard API for looking up the location of the resources by name. It is a directory service used by the application components and the containers.

JAX-RS

Java API for RESTful services, a framework for processing the HTTP Representation State Transfer (REST) style requests and responses.

JAX-WS

Java API for the XML-based web services, a framework in Java to process the SOAP, WSDL documents in the distributed systems.

JavaMail

JavaMail is a standard API that allows the Enterprise Java application to send and receive e-mail. It has support for both the MIME and plain text e-mail.

Let's dispense with the theory and look at some of the Java EE 7 code.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.228.88