s20 an introduction to jca (j2ee connector architecture)read.pudn.com/downloads110/ebook/455310/an...

33
S20 An Introduction to JCA (J2EE Connector Architecture) Deepak Kohli ([email protected]) Silicon Valley Lab, IBM GSE Nordic Region 2007 Technical Conference Hämeenlinna, Finland May 21-23, 2007

Upload: duongdan

Post on 11-Mar-2018

218 views

Category:

Documents


5 download

TRANSCRIPT

S20An Introduction to JCA

(J2EE Connector Architecture)

Deepak Kohli ([email protected])Silicon Valley Lab, IBM

GSE Nordic Region 2007 Technical Conference

Hämeenlinna, Finland May 21-23, 2007

GSE Nordic Region 2007 Technical Conference 2

An Intro to JCA

n JCA = J2EE Connector Architecture

n Formerly J2C

n Extension of J2EE Architecture

n Defines a standard architecture for connecting the J2EE platform to heterogeneous Enterprise Information Systems (EISs)

n Example EISs

– Mainframe Transaction Processing System - CICS

– Mainframe TM/DB system - IMS

GSE Nordic Region 2007 Technical Conference 3

An Intro to JCA…

EIS

n A standard architecture for connecting the J2EE platform to EISs

n But what is J2EE ?

J2EEPlatform

GSE Nordic Region 2007 Technical Conference 4

Traditional Enterprise Architecture

Mainframe Server

• Application Logic• Networking• User Interface• Data Access

Tier 1 Tier 2

SimpleClient

Simple Client

n Clients are typically “dumb” terminals

n Presentation logic, Business logic & Data Access logic all rolled into one

n Functional changes require recompilation of many parts

GSE Nordic Region 2007 Technical Conference 5

Client Server Architecture

Database Server

• Networking• Data Access

Tier 1 Tier 2

Rich Client

Rich Client

• Application Logic• User Interface

• Application Logic• User Interface

n Data can be shared by multiple Applications (on different Machines)

n Data access logic is independent

n But Rich or Thick client

GSE Nordic Region 2007 Technical Conference 6

N-Tiered Component-based Systems

Client

Client

Legacy Systems

DatabaseServer

Tier 2 Tier 3Tier 1

BusinessApplication Server

Business Objects

n Internet introduced Web Browser – preferred user interface

n Middle tier manages application’s Business logic

GSE Nordic Region 2007 Technical Conference 7

N-Tiered Component-based Systems

BrowserClient

BrowserClient

Legacy Systems

DatabaseServer

Tier 2 Tier 3Tier 1

Client

Business Application Server

Business ObjectsPresentationLogic

n Thick clients become Thinner

n Different types of presentation logic can all access Business logic

GSE Nordic Region 2007 Technical Conference 8

What is J2EE ?

n A standard – based Architecture

n Provides a component–based approach to the design,development, Assembly, and deployment of multi-tiered distributed enterprise applications.

nJ2EE defines a complete platform that guarantees services in such areas as:

– Security– Transaction Management– Resource Management– Naming and directory– Messaging– Concurrency control– Interoperability

GSE Nordic Region 2007 Technical Conference 9

J2EE Containers

n Services are provided by J2EE containers in which J2EE components run

n Containers supply a runtime environment for J2EE components

n Container Types:

– Application client container

– Web container

– Enterprise JavaBean (EJB) container

GSE Nordic Region 2007 Technical Conference 10

J2EE Components

n J2EE applications are made up of components

n A J2EE component is a self-contained functional software unit that is assembled with its related classes & files and that communicates with other components.

n J2EE components types:

– Web Components: Servlets & JSPs run on the server

– Business components: EJBs run on the server

– Application clients & Applets, components that run on the client

GSE Nordic Region 2007 Technical Conference 11

J2EE Components

Servlets/JSPsServlets/JSPs

DynamicHTML Pages

DynamicHTML Pages

EnterpriseBeans

EnterpriseBeansEnterprise

BeansEnterprise

Beans

ApplicationClient

DatabaseDatabase

J2EEApplication 1

J2EEApplication 2

ClientTier

WebTier

BusinessTier

EISTier

ClientMachine

J2EEServerMachine

DatabaseServermachine

GSE Nordic Region 2007 Technical Conference 12

J2EE Server Model

Graphic Here

EJBs

J2EE Core Services

Web Container EJB Container

WebBrowser

Client

RM

I / II

OP

HTT

P /

HTT

PS

JDB

C /

JC

A R

eso

urc

e A

dap

ters

EnterpriseInformationSystem(e.g. IMS)

JSPs

Servlets

“”

Doing business on the Web continues to be a top priority for companies worldwide. Many are turning to Java 2 platform Enterprise Edition (J2EE) technology as the foundation for their web-based applications. META estimates J2EE is utilized by at least 80% of the Global 2000.

GSE Nordic Region 2007 Technical Conference 13

Integration Complexity

n Need to integrate Web-based applications with resources & data in EISs. Why?

n Essence of e-business strategy:

– Leverage & transform existing infrastructure

– Combine it with web & other open technologies

n To support new business process such as business-to-business (B2B) transactions.

GSE Nordic Region 2007 Technical Conference 14

Integration ComplexityApplication servers

Enterprise information systems

WebSphere

…CICS

n Prior to JCA no standard for integration existed

n Each EIS supplied its own solution

n An EIS usually didn’t support all J2EE application servers

n Difficult to write truly portable applications that integrated with EISs

IMS

WebLogic JBoss

GSE Nordic Region 2007 Technical Conference 15

JCA Simplifies IntegrationApplication Servers

Resource adapter

Enterprise information systems

n Any JCA-enabled application Server can integrate with any JCA Compliant EIS

n Several Application servers connecting to a single EIS

GSE Nordic Region 2007 Technical Conference 16

JCA Simplifies Integration

Application Servers

Resource adapters

Enterprise information systems

n A single application server connecting to several EISs

GSE Nordic Region 2007 Technical Conference 17

Elements of JCA

EnterpriseBean

EnterpriseBean

WebComponent

WebComponent

J2EE Server

SystemContracts

ApplicationContract (CCI)

EIS

Managers:

TransactionConnectionSecurity

Resource Adapter

ApplicationContract (CCI)

n System contracts

n Client API

n Resource adapter module

GSE Nordic Region 2007 Technical Conference 18

System Contracts

n Define the connection between the application server & the EIS

– EIS side of the contract is implemented bya Resource Adapter

– Resource Adapter: system-level softwaredriver specific to the EIS

n Application Server & Resource Adapter collaborated by the means of the system contracts to provide secure, robust, scalable access to EIS

GSE Nordic Region 2007 Technical Conference 19

System Contracts…n Three types:

n Connection Management Contract enables physical connections to the EIS and pooling of those connects

n Transaction Management Contract supports accessto EIS in a transactional context

– XA transaction (across multiple resource managers)

– Local transactions

n Security Management contract supports authentication,authorization and secure access to EIS

GSE Nordic Region 2007 Technical Conference 20

Application Contract (CCI)

n Standard client API for interactions between an application component and the Resourcer Adapter

n Common Client Interface (CCI)

GSE Nordic Region 2007 Technical Conference 21

Resource Adapter Module

n Contains all elements necessary to provide EISconnectivity to applications:

–The Java classes and interfaces that implementthe resource adapter

– Any utility Java classes required by the resource adapter

– Any EIS-specific platform-dependent native libraries

– The deployment descriptor

GSE Nordic Region 2007 Technical Conference 22

Resource Adapter packaging

n Packaged in a Resource Adapter Archive (RAR)file i.e. file extension .rar

n All Java classes & interfaces are packaged in a JAR file & contained within the RAR file

n Deployment Descriptor is named ra.xml located in the META-INF folder of the RAR file

GSE Nordic Region 2007 Technical Conference 23

JCA Infrastructure(a little more detail)

GSE Nordic Region 2007 Technical Conference 24

Connection Management ProcessApplication Component

ConnectionFactorygetConnection()

Connection

ManagedConnectionFactorycreateManagedConnection()

Managed Connection

ConnectionManagerallocateConnection()

ConnectionEventListener

Server Services

Enterprise Information System

Application Server Resource Server

GSE Nordic Region 2007 Technical Conference 25

Transaction Management ProcessApplication Component

Connection

LocalTransaction

ConnectionEventListener

Enterprise Information System

Application Server

Server Services

Transaction Manager XAResource

Resource Adapter

ManagedConnectiongetXAResource ()getLocalTransaction ()

GSE Nordic Region 2007 Technical Conference 26

Security Management ProcessApplication Component

ConnectionFactory

ManagedConnectionFactorycreateManagedConnection()

ConnectionManager

Server Services(Security)

Enterprise Information System

Application Server Resource Adapter

n Uses the Java Authentication & Authorization Service(JAAS) subject class to provide security info

GSE Nordic Region 2007 Technical Conference 27

Common Client Interface

n The CCI’s is divided into five parts:

– Connection-related interfaces

– Interaction-related interfaces

– Data representation-related interfaces

– Metadata-related interfaces

– Exceptions and warnings

GSE Nordic Region 2007 Technical Conference 28

Common Client Interface

n CCI interfaces and classes are as follows:

– Connection Factory: Provides an application component with a connection instance to an EIS.

– Connection: Represents the connection to the underlying EIS.

– ConnectionSpec: Provides a means for an application componentto pass Connection-request-specific properties to the ConnectionFactory when making a connection request.

– Interaction: Provides a means for an application component to execute EIS functions, such as database stored procedures.

– InteractionSpec: Holds properties pertaining to an application component’s interaction with an EIS

– Record: The superclass for the various kinds of record instances. Record Instances can be MappedRecord, IndexRecord, orResultSet instances, all Of which inherit from the Record Interface.

GSE Nordic Region 2007 Technical Conference 29

Resource Adapter Examples

GSE Nordic Region 2007 Technical Conference 30

CICS Transaction Gateway

JSP

EJB

CICS ECIResourceadapter

COBOLapplication

Distributed Platform

WebSphere Application Server CICS Transaction Server

HTML

SNA orTCP62 or TCP/IP

z/OS

Servlet

CCI

CICS TransactionGateway

Clientdaemon C

OM

ME

RE

A

GSE Nordic Region 2007 Technical Conference 31

IMS TM Resource Adapter (formerly IC4J)

WebSphere Application Server

EnterpriseBean

IMSIMSTM Resource TM Resource

AdapterAdapter

Managers:

• Connection• Security• Transaction

WebComponent

CCIApplication

Contract

SPISystem

Contracts

IMS Connect

IMS

OTMA

TCP/IP

(z/OS, Windows, AIX, HP_UX,Linux, zLinux, and Solaris)

GSE Nordic Region 2007 Technical Conference 32

References

n For further information on the J2EE Connector architecture, see:

– J2EE Connector 1.5 specification

http://java.sun.com/j2ee/connector/download.html

– The J2EE Connector Web site

http://java.sun.com/j2ee/connector

GSE Nordic Region 2007 Technical Conference 33

Click to edit Master title style

Thank you