Professional Java Server Programming J2EE 1.3 Edition

Professional Java Server Programming J2EE 1.3 Edition

by Apress, Longshaw, Rod Johnson, Tyler Jewell, John Davies
     
 
The release of the 1.3 version of the Java 2 Platform, Enterprise Edition (J2EE) represents the evolution of Sun Microsystems' server-side development platform into a more mature and sophisticated specification. Servlets 2.3 gain events and filtering; JavaServer Pages (JSP) 1.2 gain a new XML syntax and enhancements to the custom tag mechanisms; and Enterprise

Overview

The release of the 1.3 version of the Java 2 Platform, Enterprise Edition (J2EE) represents the evolution of Sun Microsystems' server-side development platform into a more mature and sophisticated specification. Servlets 2.3 gain events and filtering; JavaServer Pages (JSP) 1.2 gain a new XML syntax and enhancements to the custom tag mechanisms; and Enterprise JavaBeans (EJB) 2.0 has some significant changes to its container-managed persistence model, as well as support for asynchronous processing with the new message-driven beans.

This book demonstrates how to design and construct secure and scalable n-tier J2EE applications, using JSP and servlets for the web tier and EJBs for the business logic. It also covers J2EE Connector Architecture that allows you to easily integrate your J2EE applications to enterprise information systems.

This book covers:

  • The J2EE container architecture and runtime services
  • Web component development with Servlets 2.3 and JavaServer Pages 1.2
  • Business logic components with EJB 2.0, including container-managed persistence, EJB QL, and message-driven beans
  • Underlying J2EE technologies for distributed development - RMI, JDBC and JNDI
  • Introduction to Web Services covering SOAP, SwA, WSDL, and UDDI

Product Details

ISBN-13:
9781861005373
Publisher:
Apress
Publication date:
09/28/2001
Series:
Professional Ser.
Edition description:
2001
Pages:
1600
Product dimensions:
(w) x (h) x 0.07(d)

Read an Excerpt

Chapter 20: The J2EE Connector Architecture

This chapter presents an introduction to the J2EE Connector Architecture (JCA), a significant new addition to the J2EE platform in version 1.3. JCA is an enterprise application integration initiative providing a standardized architecture to enable J2EE components to have "plug-and-play" access to heterogeneous Enterprise Information Systems (EIS), which include ERP, transaction processing, and legacy database systems.

Over the course of this chapter we'll study the J2EE Connector Architecture and develop J2EE Connector components to allow J2EE applications to integrate and interact with backend EIS resources. In particular, we will be focusing on the following:

  • EIS integration issues and the role of JCA
  • JCA architecture, services, and API
  • How JCA works within a J2EE framework
  • Programming with the Common Client Interface (CCI)
  • Building a JCA component
  • The rules that a JCA developer must follow
  • How to deploy and test JCA components
  • Potential benefits of using JCA
  • Current limitations of JCA 1.0
The current Connector Architecture specification is available at Sun's Java site at http://java.sun.com/j2ee/connector/. Additionally, there is a list of J2EE vendors supporting the specification available at http://java.sun.com/j2ee/connector/products.html, but at this time only the J2EE 1.3 Reference Implementation and couple of J2EE vendors have made their beta implementations available. Also available is a list of EIS vendors supporting this architecture to provide their EIS-specific resource-adapters. However, at the time of writing, no EIS vendors have made their beta EIS resource-adapters available.

EIS Integration and the Role of JCA

In this age of e-business, Internet-enabling business applications and integrating businesses across the Internet has become fundamental for their competitive advantages. However, prior to the Internet economy, many companies and businesses had already invested heavily in business and management information application systems, such as:
  • Enterprise Resource Planning (ERP) applications, like SAP R/3 and BAAN.
  • Customer Relationship Management (CRM) applications, such as Siebel and Clarify.
  • Database applications, such as DB2 and Sybase.
  • Mainframe transaction processing applications, such as CICS.
  • Legacy Database systems, such as IBM's IMS
These systems are generally referred to as Enterprise Information Systems (EIS).

An Enterprise Information System (EIS) provides the information infrastructure and services for an enterprise. This information may be in the form of a set of records in a database, business objects in an ERP, a workflow object in a customer relationship management (CRM) system, or a transaction program in a transaction processing application.

Leveraging these complex business applications into a multi-tiered application framework is quite challenging, and implementing them for a high-availability web application is a mammoth project.

Before the Connector Architecture, some application server vendors provided or supported a variety of custom adapters for integrating EIS systems. These adapters basically provided custom native interfaces, which were complex to understand and were limited in that they attempted to support a standard architecture. More specifically, some of these limitations were as follows:

  • Application programming for EIS is proprietary in nature, and the sheer variety of application systems meant there was no generic interface mechanism for integration with open architectures.

  • Large-scale web applications require high-availability and scalability in respect of the number of clients, connection management, etc. Traditionally, the number of clients and their active connections are expensive in an EIS and custom adapters lack support for connection management mechanisms provided by application servers.

  • Managing security and distributed transactions with multiple backend applications is extremely complex and lacks reliable mechanisms. This meant there was no standard infrastructure solution available to provide a vendor-neutral security mechanism and generic transaction-management support to multiple EIS resource managers. This can pose huge problems with the implementation of EAI.
Addressing the above challenges, Sun Microsystems has released the J2EE Connector Architecture 1.0 to provide a standard architecture for integration of J2EE servers with heterogeneous EIS resources. Its primary goal is to simplify the development process for integration by defining a common API and a common set of services within a consistent J2EE environment.

The J2EE Connector Architecture (JCA) provides an easy approach for developers to seamlessly integrate Enterprise Information Systems (EIS) with J2EE platform components.

The following diagram shows the new face of a J2EE 1.3 application server with JCA components and examples of potential Enterprise Information Systems...

...So, if we need to integrate a J2EE-based application with an existing EIS, all we need to do is install the appropriate EIS connector (a JCA-compliant Resource-adapter) into our application server. With the adapter installed, we can develop J2EE components to interface with the EIS using the Common Client Interface (CCI) API, in the same manner that we can use JDBC to interface with relational databases. In other words, development is simplified by having no EIS-specific programming, and a configuration completely independent of the backend EIS.

The idea is that all application server vendors will eventually implement JCA services and the EIS vendors will implement JCA-compliant EIS resource-adapters. By supporting the J2EE Connector Architecture, all J2EE compliant application servers are assured of handling multiple and heterogeneous EIS resources.

Thus, JCA boosts J2EE application developer's productivity in parallel with reducing development costs and protecting the existing investment in EIS systems by providing a scalable integration solution through J2EE.

J2EE Connector Architecture and its Elements

JCA is implemented in a J2EE 1.3-compliant application server, with a JCA-compliant resource-adapter provided by an EIS vendor. This resource-adapter is an EIS-specific, pluggable J2EE component in the application server, which provides an interface for communicating with the underlying EIS system. Basically JCA defines the following list of elements and service:
  • System-level contracts and services -define the standard interface between the J2EE components, the application server provider and the EIS system. These contracts and services are implemented in the application server by the J2EE server provider and also in the resource-adapter by the EIS vendor. The implementation of contacts and services defines a logical separation (not physical) between the application server and the resource-adapter in terms of system-level roles and responsibilities. This allows the J2EE server and the resource-adapter to co-ordinate with each other (for example, connection pooling, security, and transactions). Furthermore, it enables a JCA-compliant resource-adapter to be pluggable into any J2EE server.

  • The JCA Common Client Interface (CCI) -defines a client API that J2EE components (like JSPs, EJBs, etc.) can use to connect to and interact with EIS systems. In addition to J2EE client components, it also allows non-managed applications (like Java applets and application clients) to integrate with an EIS using a JCA-compliant resource-adapter.

  • Packaging and deployment interfaces -allow various EIS resource adapters to plug into J2EE applications.
The following diagram illustrates the J2EE connector architecture and components accessing EIS resources...

...The resource-adapter can clearly be seen as the fundamental component of the JCA, as it serves as the central connector between the J2EE components, the application server, and the EIS system.

In a J2EE application framework using JCA, EIS vendors provide JCA-compliant resource-adapters with CCI as a part of their implementation. J2EE server vendors provide application servers supporting JCA system-level contracts that enable these resource-adapters to plug into the application servers and provide connectivity with underlying EIS resources. This allows the J2EE application developers to develop integration components using CCI. They are therefore able to stay away from the connection, security, and transaction mechanisms meant for connectivity with an EIS or multiple EIS resources.

The JCA specification supports two types of environments, based on which type of client application uses the resource-adapter:

  • Managed Environment
    Defines a multi-tier, web-enabled, J2EE-based application that accesses EIS(s). The application may contain one or more application components (for example, EJBs, JSP pages, servlets), which are deployed on their respective containers. In the context of JCA, these applications are referred as managed applications.

  • Non-managed Environment
    The connector architecture supports access to EIS(s) from clients like applets or Java client applications. Typically it is in a two-tier architecture where an application client directly uses a resource-adapter library. In this case the resource-adapter provides low-level transactions and security to its clients. In a JCA context, these applications are referred as non-managed applications.
We'll look at connecting with both of these environments later in this chapter.

Comparing JCA with JDBC

In general, JCA and JDBC are similar technologies with identical mechanisms with respect to connection and transaction management.

Resource-adapters for EIS systems are analogous to JDBC drivers for relational databases.

The following table presents a comparison between JCA and JDBC, and demonstrates the similarities (and differences) between the two...

...So, after the comparison, the difference between the two technologies is clear -JDBC provides drivers and a client API for connection and integration with relational database applications, whereas the JCA provides resource-adapters and a client API (CCI) to enable seamless integration to EIS resources....

Meet the Author

Subrahmanyam Allamaraju is a Senior Engineer with BEA Systems Inc. He works in the areas of enterprise/distributed technologies; XML based object models, and related areas.

Cedric Beust is a senior software engineer in the EJB team at BEA Systems. He's been involved in implementing the EJB 2.0 version of the Weblogic EJB Container.

Marc Wilcox is in the professional services group at WebCT, Inc, the world's leading developer of Course Management Systems/Virtual Learning Environments. The next version of their product, code-named Cobalt, will be based on a J2EE application environment.

Sameer Tyagi writes regularly for online and print publications. He has over four years of experience in software design and development and specializes in server side Java based distribution applications.

Rod Johnson is an enterprise Java architect specializing in scalable web applications. He spent the last 2 years designing a J2EE solution for FT.com.

Gary Watson has been developing using Java for the past 4 years. He is a Freelance IT Consultant and currently a Technical Architect at the Financial Times. He can be reached at Gary@com-contracts.demon.co.uk.

Alan Williamson has worked in mainly research & developing roles until starting up the UK's first pure Java consultancy company. Alan is also Editor-in-Chief of the worlds largest Java magazine; Java Developers Journal.

John Davies is the CTO of Century 24 Solutions Ltd., providing Java and J2EE based solutions for the financial market. John is currently engaged with BNP-Paribas leading the Technology Consulting Group. John can be reached at John.Davies@C24Solutions.com.

Ramesh Nagappan is a Technology Architect specializing in Java and CORBA based Distribution application architectures. He is a Java evangelist and also an active contributor for open source specifications and implementations. He can be reached at nramesh@mediaone.net.

Andy Longshaw is an independent consultant, writer and educator specialising in J2EE, XML, Web-based technologies and components, particularly the design and architecture decisions required to use these technologies successfully.

A contractor to Sun Microsystems, Dr. P. G. Sarang trains Sun's corporate clients on various courses from Sun's official curriculum. He also conducts the "Train The Trainers" program and "Instructor Authorization Tests" on behalf of Sun.

Tyler Jewell is an Evangelist for BEA Systems, Inc. where he writes and speaks about enterprise technologies for developers. He is an expert trainer and mentor, specializing is large-scale e-business architectures.

Alex Toussaint is Director of Engineering for Vignette Corporation and has contributed articles on web application and electronic commerce to online journals, such as Microsoft MSDN. You can contact him by email at alex_toussaint@yahoo.com.

Customer Reviews

Average Review:

Write a Review

and post it to your social network

     

Most Helpful Customer Reviews

See all customer reviews >