Вы находитесь на странице: 1из 6

UNIT I

J2EE Platform 9

Introduction -Enterprise Architecture Styles - J2EE Architecture - Containers - J2EE


Technologies - Developing J2EE Applications - Naming and directory services - Using JNDI -
JNDI Service providers - Java and LDAP - LDAP operations - Searching an LDAP server -
Storing and retrieving java objects in LDAP - Application Servers - Implementing the J2EE
Specifications - J2EE packaging and Deployment - J2EE packaging overview - Configuring
J2EE packages

INTRODUCTION

J2EE is a standard for building and deploying enterprise applications, held together by the
specifications of the APIs that it defines and the services that J2EE provides. In other words, this
means that the "write once, run anywhere" promises of Java apply for enterprise applications too:

 Enterprise applications can be run on different platforms supporting the Java 2 platform.
 Enterprise applications are portable between application servers supporting the J2EE
specification.

Java Enterprise System Architecture

This chapter provides an overview of the architectural concepts upon which Java Enterprise
System deployments are based.

Dimension 1: Logical Tiers

The standard architecture for distributed applications separates application logic into a number
of tiers. These tiers signify a logical and physical organization of components into an ordered
chain of service providers and consumers. Components within a tier typically consume the
services provided by components in an adjacent provider tier and provide services to one or more
components in an adjacent consumer tier.
Description of Logical Tiers

The descriptions, refer to components implemented using the Java 2 Platform, Enterprise
Edition (J2EE™ platform) component model. However, other distributed component models,
such as CORBA, also support this architecture.

Client Tier

The client tier consists of application logic accessed directly by an end user through a user
interface. The logic in the client tier could include browser-based clients, Java components
running on a desktop computer, or Java 2 Platform, Micro Edition (J2ME™ platform) mobile
clients running on a handheld device.

Presentation Tier

The presentation tier consists of application logic that prepares data for delivery to the client tier
and processes requests from the client tier for delivery to back-end business logic. The logic in
the presentation tier typically consists of J2EE components such as Java Servlet components or
JSP components that prepare data for HTML or XML delivery or that receive requests for
processing. This tier might also include a portal service that can provide personalized, secure,
and customized access to business services in the business service tier.

Business Service Tier

The business service tier consists of logic that performs the main functions of the application:
processing data, implementing business rules, coordinating multiple users, and managing
external resources such as databases or legacy systems. Typically, this tier consists of tightly
coupled components that conform to the J2EE distributed component model, such as EJB
components or message-driven beans (MDBs).

Data Tier

The data tier consists of data used by business logic. The data can be persistent application data
stored in a database management system or it can be resource and directory information stored in
a Lightweight Directory Access Protocol (LDAP) data store. The data can also include data feeds
from external sources or data accessible from legacy computing systems.

Logical and Physical Independence

The services shown in the presentation and business service tiers are the centerpiece of this
model. These services are multi-threaded software processes capable of supporting large
numbers of clients. These clients can be either end-user clients or other services.

 Logical independence
 Physical independence.
Example of Tiered Architecture

The e-mail communication services provided by Messaging Server are an example of the use of
logical tiers in architectural design. E-mail services are implemented using a number of
Messaging Server components, as shown in the following figure.

[D]

Container

J2ee technology

Java 2 Enterprise Edition (J2EE) provides an object-oriented, distributed and cross-platform


framework for developing and deploying robust, secure and scalable E-Business and E-
Commerce applications. J2EE enables efficient development of enterprise applications, while
leveraging investments in existing business resources such as Database Systems, Messaging
Systems and Naming and Directory Services. Using J2EE, enterprise developers may implement
business objects using the Enterprise JavaBeans (EJB) technology and deploy them across a
wide range of J2EE compliant application servers. Enterprise developers may also build
sophisticated clients for their E-Business applications using the Java Servlet, Java Server Pages
(JSP), XML or the Java Applet technologies. These clients may be packaged and deployed on a
Web Container. J2EE enables component-based development of both the business logic and the
presentation logic. Using this approach, enables the development of thin HTML, DHTML and
JavaScript based clients. J2EE also supports the development of complex clients as regular Java
applications and applets.

Developing j2ee applications


Although a J2EE application client (thin client) is a Java application, it differs from a
stand-alone Java application client because it is a J2EE component, hence it offers the
advantages of portability to other J2EE-compliant servers, and can access J2EE services.
BEA provides two application client JAR files:
 A standard client JAR (wlclient.jar) that provides J2EE functionality.
 A JMS client JAR (wljmsclient.jar), which when deployed with the wlclient.jar, provides
J2EE and WebLogic JMS functionality. Both application client JAR files reside in
the WL_HOME/server/lib subdirectory of the WebLogic Server installation directory.

Naming and Directory Concepts Start here to get an overview of naming and directory
concepts.

JNDI Overview Gives you an overview of JNDI, its architecture and packaging.

Software Setup Describes instructions and steps involved in setting an environment that is
required to run the examples described in this trail as well as any other JNDI application.

Naming and Directory Operations Describes various naming and directory operations and
demonstrates them through plenty of examples that access naming/directory services using JNDI.

Advanced Topics for LDAP users A specialized lesson for the LDAP users. It talks about
modeling JNDI as an LDAP API, how to perform LDAP authentication, SSL and managing
connections in production environments.

Accessing Objects in the Directory Shows you how to integrate your application with the
directory, so that you can store and retrieve Java objects to and from the directory.

Features in JDK 5.0 and JDK 6 Introduces to the features in the JNDI and the LDAP Service
Provider that are available in JDK 5.0 and JDK 6.
USING JNDI

JNDI directory-service support is both comprehensive and powerful. It adds advanced functions,
like storing and retrieving serialized class instances, to searching and other components of the
basic suite of direct functions. This month, we will pass on the advanced features and focus on
understanding basic JNDI directory functionality.

With this thought in mind, let's examine the DirContext class -- the heart of JNDI directory
services.

LDAP

The Lightweight Directory Access Protocol (LDAP) is an Internet standard for accessing
directory services. The JNDI/LDAP service provider provides access to servers implementing
the LDAP protocols.

LDAP OPERATIONS

ADD

BIND

MODIFY

DELETE

APPLICATION SERVER
An application server is a software framework that provides both facilities to create web
applications and a server environment to run them.

J2EE Platform being the runtime infrastructure within which enterprise applications are
deployed. The platform contains four containers, or runtime environments, each of which in turn
contains application components. You also saw that some of the services that J2EE demands
must be available to these components and that the components access the services using the
J2EE API.

A packaging specification is master data. The packaging specification defines all the necessary
packing levels for a product in order, for example, to put away or transport the product. For a
product, a packaging specification mainly describes in which quantities you can pack the product
into which packaging materials in which sequence.

Configuring J2EE Containers

Sun ONE Application Server 7, Enterprise Edition provides various J2EE containers in
compliance with the J2EE 1.3 specification. Containers provide runtime support for J2EE
application components such as Enterprise Java Beans (EJBs) and Message Driven Beans
(MDBs). MDBs and EJBs never interact directly with other J2EE application components. They
use the protocols and methods of the EJB container for interacting with each other and with
platform services, such as the Java Transaction Service. The container is interposed between
application components and J2EE services. This allows the container to transparently inject the
services defined by the components' deployment descriptors, such as declarative transaction
management, security checks, resource pooling, and state management.

Sun One Application Server incorporates the Web Container and the EJB Container.

This chapter includes the following topics:

 About the Web Container


 About the EJB Container