J2EE Platform Technologies
three categories: component, service, and communication
Component Technologies
J2EE platform supports the following
types of components: applets, application clients, Enterprise JavaBeansTM
(EJBTM)components, Web components, and resource adapter components.
Types of J2EE Clients
1 Applets are Java-based client components that usually execute within a Web
browser, and that have access to all features of the Java programming language.
J2EE applications can use applets for a more powerful user interface.
Browser-based applet clients communicate over HTTP.
2 Anapplication client executes in its own client container. (The client container
is a set of libraries and APIs that support the client code.) Application clients
are user interface programs that can directly interact with the EJB tier of a
J2EE platform-based application using RMI-IIOP. These clients have full access
to J2EE platform services such as JNDI lookups, asynchronous messaging,
and the JDBCTM API. An application client抯 container provides access to
these J2EE services and handles RMI-IIOP communication.
3 AJava Web Start-enabled rich client is a stand-alone client based on
JFC/Swing APIs and enabled for the J2EE platform through the Java Web Start
technology. A rich client has increased user interface features available to it,
such as a better interactive environment and richer graphic capabilities, along
with the J2EE platform features and services. Java Web Start technology enables
application deployment through a single-step download-and-launch process
performed by means of a Web browser. Rich clients communicate with
the server using the J2SE environment to execute XML over HTTP(S). As
Web service technologies gain ground in the future, these rich clients are wellpositioned
to efficiently use open communication standards such as JAX-RPC
technology.
4 Awireless client is based on Mobile Information Device Profile (MIDP) technology.
MIDP is a set of Java APIs which, along with Connected Limited Device
Configuration (CLDC), provides a complete J2ME environment for
wireless devices.
Web Components
A Web component is a software entity that provides a response to a request. A Web
component typically generates the user interface for a Web-based application. The
J2EE platform specifies two types of Web components: servlets and JavaServer
PagesTM (JSPTM) pages.
1 servlet A servlet is a component that extends the functionality of a Web server in a portable
and efficient manner.
A servlet developer uses the servlet API to:
Initialize and finalize a servlet
Access a servlet抯 environment
Receive/forward requests and send responses
Maintain session information on behalf of a client
Interact with other servlets and other components
Use a filter mechanism for pre- and post-processing of requests and responses
Implement and enforce security at the Web tier
2 JavaServer Pages Technology
Template data to format the Web document. Typically the template data uses
HTML or XML elements. Document designers can edit and work with these
elements on the JSP page without affecting the dynamic content. This approach
simplifies development because it separates presentation from dynamic
content generation.
JSP elements and scriptlets to generate the dynamic content in the Web document.
Most JSP pages use JavaBeans and/or Enterprise JavaBeans components
to perform the more complex processing required of the application. Standard
JSP actions can access and instantiate beans, set or retrieve bean attributes, and
download applets. JSP technology is extensible through the development of
custom actions, or tags, which are encapsulated in tag libraries.
3 Web Component Containers
Enterprise JavaBeans Components
The Enterprise JavaBeans architecture is a server-side technology for developing
and deploying components containing the business logic of an enterprise application.
Enterprise JavaBeans components, also referred to as enterprise beans, are
scalable, transactional, and multi-user secure. There are three types of enterprise
beans: session beans, entity beans, and message-driven beans. Session and entity
beans have two types of interfaces: a component interface and a home interface. The
home interface defines methods to create, find, remove, and access metadata for the
bean. The component interfaces define the bean’s business logic methods. Messagedriven
beans do not have component and home interfaces.
1 Session Beans
A session bean is created to provide some service on behalf of a client and usually
exists only for the duration of a single client-server session. A session bean performs
operations such as calculations or accessing a database for the client. While a
session bean may be transactional, it is not recoverable should its container crash.
Session beans can be stateless or can maintain conversational state across
methods and transactions. If they do maintain state, the EJB container manages
this state if the object must be removed from memory. However, the session bean
object itself must manage its own persistent data.
2 Entity Beans
An entity bean is a persistent object that represents data maintained in a data store;
its focus is data-centric. An entity bean is identified by a primary key. An entity
bean can manage its own persistence or it can delegate this function to its container.
Bean-managed persistence the developer handles persistence as part of the
entity bean source code.
Container-managed persistence the developer specifies the bean fields
that need to be persistent and lets the EJB container manage persistence.
Beans with container-managed persistence are more portable across databases.
In addition, entity beans with container-managed persistence can maintain
relationships among themselves. This feature enables queries that join multiple
database tables. With bean-managed persistence, a change in the underlying database
may require the developer to change the entity bean’s source code to conform
to the SQL implemented by the new database.
3 Message-Driven Beans
A message-driven bean enables asynchronous clients to access the business logic in
the EJB tier. Message-driven beans are activated only by asynchronous messages
received from a JMS queue to which they listen. A client does not directly access a
message-driven bean; instead, a client asynchronously sends a message to a JMS
queue or topic. Because message-driven beans have no need to expose their methods
to clients, they do not implement component or home interfaces. They also do not
maintain state on behalf of a client.
4 EJB Component Containers
Enterprise beans are hosted by an EJB container. In addition to standard container
services, an EJB container provides a range of transaction and persistence services
and access to the J2EE service and communication APIs.
Platform Roles
Platform Services
J2EE platform services simplify application programming and allow components
and applications to be customized at deployment time to use resources available in
the deployment environment. This section gives a brief overview of the J2EE platform
naming, deployment, transaction, and security services.
1.Naming Services
2.Deployment Services
Deployment Units
3.Transaction Services
Accessing Transactions
JTA transactions are created and managed using the
javax.transaction.UserTransaction interface. Different types of components
access UserTransaction objects in different ways:
Web Component Transactions
Enterprise Bean Transactions
4.Security Services
1. Authentication—An entity must establish its identity through authentication.
It typically does so by providing authentication data (such as a name and password).
An entity that can be authenticated is called a principal. A principal can
be a user or another program. Users are typically authenticated by logging in.
2. Authorization—When an authenticated principal tries to access a resource,
the system determines whether the principal is authorized to do so based on the
security policies in force in the application’s security policy domain.
Security Methodologies
1.Authentication
2.Authorization
3.Java Authentication and Authorization Services
Service Technologies
1.JDBC API
2.Java Transaction API and Service (JTA)
3.Java Naming and Directory Interface
4.J2EE Connector Architecture
5.Java API for XML Processing Technology
Communication Technologies
Internet protocols
Remote method invocation protocols
Object Management Group protocols
Messaging technologies
Data formats


