developing j2ee connector architecture

32
Developing J2EE Connector Architecture David Lucas President Lucas Software Engineering, Inc [email protected]

Upload: aamir97

Post on 14-Jun-2015

808 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Developing J2EE Connector Architecture

Developing J2EE Connector Architecture

David LucasPresidentLucas Software Engineering, [email protected]

Page 2: Developing J2EE Connector Architecture

AgendaAgenda• Introduction

• What is a Connector?

• Overview of Sun’s JCA

• VisiConnect

• Deployment to BES

• Client Interface

• Demo

• Summary

Page 3: Developing J2EE Connector Architecture

IntroductionIntroduction

• Welcome

• Application Servers

• JDBC

• Enterprise Information System

Page 4: Developing J2EE Connector Architecture

What is a Connector?What is a Connector?

• Like a bridge, it attaches two ends together, J2EE and EIS

AppServerEIS

ResourceAdapter

Connector

Page 5: Developing J2EE Connector Architecture

Overview - TermsOverview - Terms

• EIS Resource (CICS, SAP, …)

• Resource Manager

• Managed Environment

• Non-Managed Environment

Page 6: Developing J2EE Connector Architecture

Overview of Sun’s JCAOverview of Sun’s JCA• Part of J2EE 1.3 Specification, Latest

now JCA 1.1

• Provide plug and play integration between EIS and J2EE AppServers

• Simplifies EIS vendor work

• System Contracts

• Common Client Interface (CCI)

• Deployment (RARs)

Page 7: Developing J2EE Connector Architecture

Overview of Sun’s JCAOverview of Sun’s JCA

Page 8: Developing J2EE Connector Architecture

Overview - ConnectorsOverview - Connectors• TIBCO

• IBM MQ Series

• Hogan

• IBM CICS ECI

• JD Edwards

• Lawson

PeopleSoftSAPSiebelIMS / VSAM or other data recordsB2B SOAP or XML-RPC

Page 9: Developing J2EE Connector Architecture

Overview - Potential ToolsOverview - Potential Tools• Actional

• Attunity

• Borland

• CrossWorlds

• IONA

• Merant

MercatorSybase / NEONTIBCOVitriawebMethodsWRQ

Page 10: Developing J2EE Connector Architecture

Overview - System ContractsOverview - System Contracts• Security Management

• EIS Signon via JAAS

• Transaction Management • 1PC & 2PC

• Container Managed

• Component Managed

• Connection Management• Pooling

• Error Logging & Tracing

• Connection Event Notification

Page 11: Developing J2EE Connector Architecture

Overview - DeploymentOverview - Deployment• J2EE Resource Archive

• Resource Adapter with embedded JAR and Native files

• RA.XML Descriptor

• JNDI-Definition Descriptor (vendor)

Page 12: Developing J2EE Connector Architecture

Overview - Deployment RolesOverview - Deployment Roles• Resource Adapter Provider (EIS

Vendor)

• Application Server / Container Provider (Borland and others)

• Component Provider (EJB implementations that take advantage of the Connector)

Page 13: Developing J2EE Connector Architecture

Overview - CCIOverview - CCI• Remote Function Call Interface

(similar to JDBC)

• Independent and Consistent (vendor neutral)

• Optional support for Service Provider Interfaces

• Execute Interactions with Records for Input and Output

• Supports Result Record Sets

Page 14: Developing J2EE Connector Architecture

VisiConnectVisiConnect• JCA 1.0 spec now approved

• Borland VisiConnect is available now

• Provides Management of Resource Adapters

• Currently supports basic password security

Page 15: Developing J2EE Connector Architecture

Deployment to BESDeployment to BES• RAR file is created to package

classes, interfaces, and native files

• RA and JNDI Deployment descriptors describe meta information

• Can deploy to BES as standalone or as part of an EAR

Page 16: Developing J2EE Connector Architecture

AppServer

Deployment StrategyDeployment Strategy• EJB Session wraps EIS Vendor access

Resource Adapter

EIS

EJB Session Bean

AppServer

CORBAAppServer

Client

Page 17: Developing J2EE Connector Architecture

Client InvocationClient Invocation• Obtain factory context and get Connection

to Resource Adapter

• Create Interaction (like JDBC Statement)

• Get Record Factory and create input and output Records as needed (like JDBC Result Set layout)

• Create Interaction Spec that maps function to execute with records

• Invoke execute and retrieve results

Page 18: Developing J2EE Connector Architecture

Client InvocationClient Invocation• Obtain factory context and get Connection

to Resource Adapter

javax.naming.Context context = new InitialContext(); ConnectionFactory cxfactory = (ConnectionFactory) context.lookup(“java:comp/eis/MyEIS”);

Page 19: Developing J2EE Connector Architecture

Client InvocationClient Invocation• Create Interaction (like JDBC Statement)

• Get Record Factory and create input and output Records as needed (like JDBC Result Set layout)

Interaction ix=cx.createInteration();RecordFactory rfact=cxfactory.getRecordFactory();MappedRecord input=rfact.createMappedRecord("INPUT");IndexedRecord output= rfact.createIndexedRecord("OUTPUT");

Page 20: Developing J2EE Connector Architecture

Client InvocationClient Invocation• Create Interaction Spec that maps function

to execute with records

• Invoke execute and retrieve results

InteractionSpec ixSpec = new my.eis.InteractionSpec();ixSpec.setFunctionName("INQUERY");

boolean response = ix.execute(ixSpec, input, output);

Page 21: Developing J2EE Connector Architecture

Resource AdapterResource Adapter• Execute on the Resource side

class MyInteraction implements Interaction { ...

public boolean execute(ixSpec, input, output) throws ResourceException

{boolean success = false;// grab input// execute EIS business logic// map outputreturn success;

}…}

Page 22: Developing J2EE Connector Architecture

Resource Adapter DescriptorResource Adapter Descriptor

<connector> <display-name>MyResourceAdapter</display-name> <vendor-name>ACME Software</vendor-name> <spec-version>1.0</spec-version> <eis-type>JDBC Database</eis-type> <version>1.0</version> <resourceadapter> <managedconnectionfactory-class>com.acme.ConFactory</managedconnectionfactory-class> <connectionfactory-interface>javax.resource.cci.ConnectionFactory</connectionfactory-interface> <connectionfactory-impl-class>com.acme.ConFactImpl</connectionfactory-impl-class> <connection-interface>javax.resource.cci.Connection</connection-interface> <connection-impl-class>com.acme.CciConnection</connection-impl-class> <transaction-support>local_transaction</transaction-support>...</connector>

Page 23: Developing J2EE Connector Architecture

Resource Adapter JNDI ObjectsResource Adapter JNDI Objects

<jndi-definitions> <jndi-object> <jndi-name>java:comp/env/eis/ACMEResource</jndi-name> <class-name>com.acme.ConFact</class-name> <property> <prop-name>userName</prop-name> <prop-type>java.lang.String</prop-type> <prop-value>test</prop-value> </property> <property> <prop-name>password</prop-name> <prop-type>java.lang.String</prop-type> <prop-value>test</prop-value> </property> </jndi-object></jndi-definitions>

Page 24: Developing J2EE Connector Architecture

Resource Adapter ejb-jar.xmlResource Adapter ejb-jar.xml

<ejb-jar> <enterprise-beans> <session>... <resource-env-ref>

<description>ACMEResource</description><res-env-ref-name>eis/ACMEResource</res-ref-name><res-env-type>javax.resource.cci.ConnectionFactory</res-type>

</resource-ref> </session>...</ejb-jar>

Page 25: Developing J2EE Connector Architecture

Resource Adapter ejb-borland.xmlResource Adapter ejb-borland.xml

<ejb-jar> <enterprise-beans> <session> <ejb-name>Shell</ejb-name> <bean-home-name>Shell</bean-home-name> <resource-ref> <res-ref-name>ACMEResource</res-ref-name> <jndi-name>java:comp/env/eis/ACMEResource</jndi-name> </resource-ref> <resource-env-ref> <resource-env-ref-name>eis/ACMEResource</resource-env-ref-name> <jndi-name>java:comp/env/eis/ACMEResource</jndi-name> </resource-env-ref> </session> </enterprise-beans>...</ejb-jar>

Page 26: Developing J2EE Connector Architecture

DEMODEMO• JCA to spawn a command shell and

execute the "function"

• Returns result in an output Record

Page 27: Developing J2EE Connector Architecture

SummarySummary

• JCA for J2EE 1.3 Specification

• Defines asynchronous API, app servers should follow with IMPLs

• Issues with JMS pluggability, stay tuned to JCA 1.5 spec (http://www.jcp.org/jsr/detail/112.jsp)

• VisiConnect

• Working environment in BES 5.x

• Deployment tools with Jbuilder which support RARs

Page 28: Developing J2EE Connector Architecture

ResourcesJCA 1.5 JSR 112: http://www.jcp.org/jsr/detail/112.prt

http://java.sun.com/j2ee/connector/http://www.javaworld.com/javaworld/jw-11-2001/jw-1121-jca.htmlhttp://www.javaworld.com/javaworld/jw-02-2002/jw-0201-jca2.htmlhttp://www.intelligenteai.com/feature/010416/feat1.shtml

Borland VisiConnect: http://www.borland.com/devsupport/bes/faq/visiconnect/visiconnect.html

Borland Enterprise Server Developers Guide 5http://www.borland.com/techpubs/books/bes/htmls/DevelopersGuide5/DevelopersGuide/VisiConnectOverview.html

Presentations:

Borland Software Corporation: Charlton Barreto, JavaOne 2002:- Designing and Developing JavaTM 2 Platform, Enterprise Edition (J2EETM) Connector

Page 29: Developing J2EE Connector Architecture

ResourcesBEA Systems, Inc: Deb June - Architecture Applications (TS-1032), - JavaTM 2 Platform, Enterprise Edition (J2EETM)

Connector Architecture Overview and Futures (TS-2531)

List of Providers: http://java.sun.com/j2ee/connector/industry.html

Products: http://java.sun.com/j2ee/connector/products.html

Books:

- J2EE Connector Architecture and Enterprise Application Integration by Rahul Sharma, Beth Stearns, Tony Ng, Scott Dietzen ISBN 0201775808

- Integrating Java Applications With the Enterprise, by Vijay Sarathy and Rahul Sharma, eAI Journal, May 2001

- Java Connector Architecture: The Future of EAI, by Mark Hansen and Peter Mamorski, posted to eAI Journal, May 15, 2001

Page 30: Developing J2EE Connector Architecture

Questions?

All trademarks in this presentation are those of their respective owners.

Page 31: Developing J2EE Connector Architecture

Thank You!

Please fill out the speaker evaluation. You can contact me further at …

[email protected]

Page 32: Developing J2EE Connector Architecture