Developing J2EE Connector Architecture

1,139 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,139
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
34
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • David Lucas Lucas Software Engineering, Inc. [email_address] http://www.lse.com
  • Welcome !!! I am David Lucas of Lucas Software Engineering. I have been working in the software industry over 15 years. Today I am focused on client solutions that use Java, CORBA, EJB, and XML technologies. What is your background? Java Developers? C++? Delphi? Smalltalk? VB? How many have deployed an application server into production? How many with EJBs? Application Servers have been focused on serving the presentation layer As use of multi-connection databases increased, transaction itegrity became more of an issue, hence EJB servers. JDBC useful to access databases from Java. What if your data is not in a database? EIS relates to black box type systems that are not necessarily databases, but house System of Records (SoRs). Like, CICS, Hogan, SAP, IMS, VSAM, and other custom ERP, CRM, and accounting systems.
  • The connector architecture is a standard architecture for integrating J2EE applications with EISs that are not relational databases. Each of these EISs provides a native function call API for identifying a function to call, specifying its input data, and processing its output data. The goal of the Common Client Interface (CCI) is to provide an EIS independent API for coding these EIS function calls.
  • EIS Resource (CICS, SAP, …) A record or set of records in a database system A business object in an ERP system A transaction program in a transaction processing system Resource Manager - a traffic cop to shared information. May provide transactional two phase commit capabilities (2PC) via XA. Managed Environment - multi-tier application server providing containers to manage an application, EJB, or Web service (J2EE). Non-Managed Environment - stand alone application accessing a resource in a two-tier connection model (J2SE application).
  • Provides a new plug and play environment for EIS vendors to create integration solutions to their products that are common. These implementations can then be shared on other J2EE compliant application servers. Some vendors that have mentioned/or currently participation: Borland BEA Fujitsu IBM IPlanet Motorola Oracle SAP Sun Sybase Tibco Unisys J2EE forces the connector vendors providers to support service contracts for transactions, security, and connection management. Not all vendors will fully implement all these interfaces, but will need to provide compliance to the interface in order to plug into any J2EE compliant application server. Client applications use a common interface to communicate to the EIS via a resource adapter. The Common Client Interface (CCI) resembles JDBC in how it uses statements to execute commands and returns result sets. There is a deployment descriptor for a connector’s resource adapter. This maps certain transaction, security, and management properties.
  • Clients can access Resources Adapters either directly via the JCA API or indirectly via an EJB Session Bean that does the work. EJB Session Beans are the best way to pool client use of a backend resource.
  • Security uses JAAS. Currently only basic password supported in RA. Transactions are based on EJB Container model. JTS 1PC supported as well as 2PC if RAR supports XA. Also, non-transactional is supported. Container managed, client that accesses the RA does not have to create a transaction. Components can create a user transaction from the application side to control access to RA. Connection Management is similar to the JDBC management. There are factory and connection interfaces which allow the container to manage connections. There are error logging, tracing and event notification.
  • Deployment consists of a Resource Adapter JAR file, native libraries like DLL or SO . The descriptors tell the container how to register the factory for access by a client invokation. You will need an "ra.xml" descriptor no matter what application server you deploy on. The ejb-jar.xml file will require a resource reference to identify what JNDI context contains the factory to obtain a connection.
  • Vendor EIS supplies the Resource Adapter and integrates it into a standard J2EE environment for system integrators to purchase. They work at getting the adapter to run in a common J2EE platform. Write once, test everywhere. Application Servers and Container Providers will have to support the J2EE Connector standard to allow any Resource Adapter to be able to plug in. Component Providers (the majority of develoeprs) will system integrate the Connector with the AppServer and create some business logic wrapper around the access to the EIS.
  • Interaction (like JDBC statement) InteractionSpec (like a Method definition) ConnectionMetaData (like JDBC Connection Meta Data) ResourceAdapterMetaData (like JDBC Driver Meta Data) RecordFactory IndexedRecord (like ResultSet using indexes) MappedRecord (like ResultSet using column names)
  • The connector architecture is a standard architecture for integrating J2EE applications with EISs that are not relational databases. Each of these EISs provides a native function call API for identifying a function to call, specifying its input data, and processing its output data. The goal of the Common Client Interface (CCI) is to provide an EIS independent API for coding these EIS function calls.
  • JCA 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.html http://www.javaworld.com/javaworld/jw-02-2002/jw-0201-jca2.html http://www.intelligenteai.com/feature/010416/feat1.shtml Borland VisiConnect: http://www.borland.com/devsupport/bes/faq/visiconnect/visiconnect.html Borland Enterprise Server Developers Guide 5 http://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
  • BEA 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
  • Developing J2EE Connector Architecture

    1. 1. Developing J2EE Connector Architecture David Lucas President Lucas Software Engineering, Inc [email_address]
    2. 2. Agenda <ul><li>Introduction </li></ul><ul><li>What is a Connector? </li></ul><ul><li>Overview of Sun’s JCA </li></ul><ul><li>VisiConnect </li></ul><ul><li>Deployment to BES </li></ul><ul><li>Client Interface </li></ul><ul><li>Demo </li></ul><ul><li>Summary </li></ul>
    3. 3. Introduction <ul><li>Welcome </li></ul><ul><li>Application Servers </li></ul><ul><li>JDBC </li></ul><ul><li>Enterprise Information System </li></ul>
    4. 4. What is a Connector? <ul><li>Like a bridge, it attaches two ends together, J2EE and EIS </li></ul>AppServer EIS Resource Adapter Connector
    5. 5. Overview - Terms <ul><li>EIS Resource (CICS, SAP, …) </li></ul><ul><li>Resource Manager </li></ul><ul><li>Managed Environment </li></ul><ul><li>Non-Managed Environment </li></ul>
    6. 6. Overview of Sun’s JCA <ul><li>Part of J2EE 1.3 Specification, Latest now JCA 1.1 </li></ul><ul><li>Provide plug and play integration between EIS and J2EE AppServers </li></ul><ul><li>Simplifies EIS vendor work </li></ul><ul><li>System Contracts </li></ul><ul><li>Common Client Interface (CCI) </li></ul><ul><li>Deployment (RARs) </li></ul>
    7. 7. Overview of Sun’s JCA
    8. 8. Overview - Connectors <ul><li>TIBCO </li></ul><ul><li>IBM MQ Series </li></ul><ul><li>Hogan </li></ul><ul><li>IBM CICS ECI </li></ul><ul><li>JD Edwards </li></ul><ul><li>Lawson </li></ul>PeopleSoft SAP Siebel IMS / VSAM or other data records B2B SOAP or XML-RPC
    9. 9. Overview - Potential Tools <ul><li>Actional </li></ul><ul><li>Attunity </li></ul><ul><li>Borland </li></ul><ul><li>CrossWorlds </li></ul><ul><li>IONA </li></ul><ul><li>Merant </li></ul>Mercator Sybase / NEON TIBCO Vitria webMethods WRQ
    10. 10. Overview - System Contracts <ul><li>Security Management </li></ul><ul><ul><li>EIS Signon via JAAS </li></ul></ul><ul><li>Transaction Management </li></ul><ul><ul><li>1PC & 2PC </li></ul></ul><ul><ul><li>Container Managed </li></ul></ul><ul><ul><li>Component Managed </li></ul></ul><ul><li>Connection Management </li></ul><ul><ul><li>Pooling </li></ul></ul><ul><ul><li>Error Logging & Tracing </li></ul></ul><ul><ul><li>Connection Event Notification </li></ul></ul>
    11. 11. Overview - Deployment <ul><li>J2EE Resource Archive </li></ul><ul><li>Resource Adapter with embedded JAR and Native files </li></ul><ul><li>RA.XML Descriptor </li></ul><ul><li>JNDI-Definition Descriptor (vendor) </li></ul>
    12. 12. Overview - Deployment Roles <ul><li>Resource Adapter Provider (EIS Vendor) </li></ul><ul><li>Application Server / Container Provider (Borland and others) </li></ul><ul><li>Component Provider (EJB implementations that take advantage of the Connector) </li></ul>
    13. 13. Overview - CCI <ul><li>Remote Function Call Interface (similar to JDBC) </li></ul><ul><li>Independent and Consistent (vendor neutral) </li></ul><ul><li>Optional support for Service Provider Interfaces </li></ul><ul><li>Execute Interactions with Records for Input and Output </li></ul><ul><li>Supports Result Record Sets </li></ul>
    14. 14. VisiConnect <ul><li>JCA 1.0 spec now approved </li></ul><ul><li>Borland VisiConnect is available now </li></ul><ul><li>Provides Management of Resource Adapters </li></ul><ul><li>Currently supports basic password security </li></ul>
    15. 15. Deployment to BES <ul><li>RAR file is created to package classes, interfaces, and native files </li></ul><ul><li>RA and JNDI Deployment descriptors describe meta information </li></ul><ul><li>Can deploy to BES as standalone or as part of an EAR </li></ul>
    16. 16. Deployment Strategy <ul><li>EJB Session wraps EIS Vendor access </li></ul>AppServer Resource Adapter EIS EJB Session Bean AppServer CORBA AppServer Client
    17. 17. Client Invocation <ul><li>Obtain factory context and get Connection to Resource Adapter </li></ul><ul><li>Create Interaction (like JDBC Statement) </li></ul><ul><li>Get Record Factory and create input and output Records as needed (like JDBC Result Set layout) </li></ul><ul><li>Create Interaction Spec that maps function to execute with records </li></ul><ul><li>Invoke execute and retrieve results </li></ul>
    18. 18. Client Invocation <ul><li>Obtain factory context and get Connection to Resource Adapter </li></ul>javax.naming.Context context = new InitialContext(); ConnectionFactory cxfactory = (ConnectionFactory) context.lookup(“java:comp/eis/MyEIS”);
    19. 19. Client Invocation <ul><li>Create Interaction (like JDBC Statement) </li></ul><ul><li>Get Record Factory and create input and output Records as needed (like JDBC Result Set layout) </li></ul>Interaction ix=cx.createInteration(); RecordFactory rfact=cxfactory.getRecordFactory(); MappedRecord input=rfact.createMappedRecord(&quot;INPUT&quot;); IndexedRecord output= rfact.createIndexedRecord(&quot;OUTPUT&quot;);
    20. 20. Client Invocation <ul><li>Create Interaction Spec that maps function to execute with records </li></ul><ul><li>Invoke execute and retrieve results </li></ul>InteractionSpec ixSpec = new my.eis.InteractionSpec(); ixSpec.setFunctionName(&quot;INQUERY&quot;); boolean response = ix.execute(ixSpec, input, output);
    21. 21. Resource Adapter <ul><li>Execute on the Resource side </li></ul>class MyInteraction implements Interaction { ... public boolean execute(ixSpec, input, output) throws ResourceException { boolean success = false; // grab input // execute EIS business logic // map output return success; } … }
    22. 22. Resource 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>
    23. 23. Resource 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>
    24. 24. Resource 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>
    25. 25. Resource 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>
    26. 26. DEMO <ul><li>JCA to spawn a command shell and execute the &quot;function&quot; </li></ul><ul><li>Returns result in an output Record </li></ul>
    27. 27. Summary <ul><li>JCA for J2EE 1.3 Specification </li></ul><ul><ul><li>Defines asynchronous API, app servers should follow with IMPLs </li></ul></ul><ul><ul><li>Issues with JMS pluggability, stay tuned to JCA 1.5 spec (http://www.jcp.org/jsr/detail/112.jsp) </li></ul></ul><ul><li>VisiConnect </li></ul><ul><ul><li>Working environment in BES 5.x </li></ul></ul><ul><ul><li>Deployment tools with Jbuilder which support RARs </li></ul></ul>
    28. 28. Resources JCA 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.html http://www.javaworld.com/javaworld/jw-02-2002/jw-0201-jca2.html http://www.intelligenteai.com/feature/010416/feat1.shtml Borland VisiConnect: http://www.borland.com/devsupport/bes/faq/visiconnect/visiconnect.html Borland Enterprise Server Developers Guide 5 http://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
    29. 29. Resources BEA 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
    30. 30. Questions? All trademarks in this presentation are those of their respective owners.
    31. 31. Thank You! Please fill out the speaker evaluation. You can contact me further at … [email_address]

    ×