Tutorial for building J2EE Applications using JBOSS and ECLIPSE
Chapter2:
The Java 2 Enterprise Edition (J2EE) is a multitiered architecture for implementing enterprise-class applications and web based applications.
Application clients and applets are components that run on the client.
Java Servlet and JavaServer Pages technology components are Web components that run on the web server. Enterprise JavaBeans components (enterprise beans) are business components that run on the application server.
J2EE applications are made up of different components. A J2EE component is a self-contained functional software unit that is assembled into a J2EE application with its
helper classes and files and that communicates with other components in the application. The J2EE specification defines the following J2EE components:
Application clients and applets are components that run on the client.
Java Servlet and JavaServer Pages technology components are Web components that run on the web server.
Enterprise JavaBeans components (enterprise beans) are business components that run on the application server.
All these J2EE components are assembled into a J2EE application, verified to be well formed and in compliance with the J2EE specification, and deployed to production, where they are run and managed by the J2EE application server.
In addition to these primary components, it includes standard services and supporting technologies which are :
Java Database Connectivity (JDBC) technology provides access to relational database systems.
Java Transaction API (JTA) or Java Transaction Service (JTS) provides transaction support for J2EE components.
Java Messaging Service (JMS) for asynchronous communication between J2EE components.
Java Naming and Directory Interface (JNDI) provides naming and directory access.
The figure above shows communication with business components, where an enterprise bean receives data from client programs, processes it (if necessary), and sends it to the enterprise information system tier for storage. An enterprise bean also retrieves data from storage, processes it (if necessary), and sends it back to the client program.
There are three kinds of enterprise beans: session beans (stateless and stateful), entity beans (bean managed and container managed), and message-driven beans. A session bean represents a transient conversation with a client. When the client finishes executing, the session bean and its data are gone. In contrast, an entity bean represents persistent data stored in one row of a database relation/table. If the client terminates or if the server shuts down, the underlying services ensure that the entity
bean data is saved. A message-driven bean combines features of a session bean and a Java Message Service (JMS) message listener, allowing a business component to receive JMS messages asynchronously.
Note : Java Beans are not considered J2EE components by the J2EE specification as JavaBeans are different from Enterprise Beans. JavaBeans component architecture can be used in both server and client tiers to manage the communication between an application client or applet and components running on the J2EE server or between server components and a database, whereas Enterprise JavaBeans components are only used in the business tier as a part of the server tier. JavaBeans have instance variables and has an accessor and mutator methods to access properties of bean or say, accessing the data in the instance variables which simplifies the design and implementation of JavaBeans components.
Packaging
In order to deploy a J2EE application, after developing different components, it is packaged into special archive files that contain the relevant class files and XML deployment descriptors. These XML deployment descriptors contain information specific to each bundled component and are a mechanism for configuring application behavior at assembly or deployment time. These are bundled into different archive types for different component types.
Web components are archived in Web Archive (.war) file which contains servlets, JSP and static components such as HTML and image files. The .war file contains classes and files used in web tier along with a Web component deployment descriptor.
Business components are archived in Java Archive (.jar) file which contains an EJB deployment descriptor, remote, and object interface files along with helper files required by EJB component.
Client side class files and deployment descriptors are archived in Java Archive (.jar) file which make up the client application.
J2EE application is bundled in an Enterprise Archive (.ear) file which contains the whole application along with deployment descriptor that provides information about the application and its assembled components.
J2EE Platform Roles :
Building the different components of a J2EE application involves various roles in the development, deployment and management of an enterprise application.
Distributed Architecture in J2EE :???
Java Naming Directory Interface (JNDI) Architecture : ???