Understanding JCA, Implementation and Deployment (Weblogic)
<!-- main-content-block -->Abstract
This article talks about how to build a JCA Connector based on JCA specifications, JCA framework, features and deployment strategies for Weblogic Server.
Introduction
Prior to introduction to JCA, the J2EE platform did not address the integration of java based of Java based enterprise application with Enterprise Information System (EIS) like ERP, CRM, Mainframe, and Legacy Systems etc. As such vendor specific, tightly coupled, non-portable solutions were developed to achieve the connectivity to EIS. Now JCA defines a uniform way to integrate J2EE application servers with EIS by which the application server vendors implement the Connector Framework only once and EIS vendors develop one standard resource adapter based on this architecture. Thus a JCA compliant resource adapter can be deployed in any JCA compliant Application Server like WebLogic Server.
Resource Adapter
The resource adapter plays a central role in integration and connectivity between an Application Components, Application and EIS. To enable seamless integration the resource adapter must implement System Contracts, EIS specific Contracts and Application Component contracts (Client API). These contracts are defined in terms of interfaces that the adapter must implement. The various packages that contain these interfaces are:
javax.resource.spi - Adapter Interfaces to encapsulate EIS
javax.resource.cci - Client API Interface
javax.transaction.xa - XA Transactions Support Interface
javax.security.auth - Authentication and Authorization Interface
System Contracts
The system contract defines the interactions between Resource Adapter and the Application Server. There are 3 types of system contracts some of which are optional:
1. Connection Management (required)
This contract describes the understanding, a J2EE container has with the adapter regarding connection establishment, pooling and tearing down of connections to the EIS. The underlying protocol an adapter uses connect to EIS is outside the scope of JCA specification.
Connection Management Interfaces to Implement
ConnectionManager Provides Connection ManagementIn case of non-managed environment>/td>
ManagedConnection - Represents the physical connection to EIS
ManagedConnectionFactory - Represents a Factory For Managed Connections
ManagedConnectionMetaData - Provides information about the managed connections
ConnectionRequestInfo - Encapsulates the client credentials to obtain a connection to EIS
Connection - Represents the CCI Connection after a JNDI Lookup from the CCI Connection Factory. Each CCI Connection is associated with the Managed Connection
ConnectionFactory - Represents a Factory for CCI Connections.
2.Transaction Management (optional)
This contract allows the application to manage and propagate transaction
Context from the J2EE container to the EIS. These further are of two types:
a. Local Transactions
When only one system (EIS) is involved in an interaction, transactions are internally managed by the EIS system, thus they are called Local Transactions.
b. Distributed Transactions
When multiple systems (EIS) are involved, a transaction manager (from J2EE container) external to each EIS controls and coordinates the overall transaction (i.e. ensures a two phase commit). These transactions across multiple resources are referred as XA and are defined in the Java Transaction API (JTA) specification.
* The resource adapter can support local transactions, or both type of transactions and neither type of transaction.
Transaction Management Interfaces to Implement
LocalTransaction - Provides methods for Local Transaction demarcation
XAResource - Provides methods for distributed XA Transaction demarcation
3. Security Contracts (optional)
These security contracts define a secure way to access EIS. Java Authentication and Authorization Service (JAAS) interfaces like Subject, Principal, and Generic Credential etc. are used with the Connection Management Interfaces of the Resource Adapter to achieve this.
The Application server can use two methods to authenticate to an EIS system (via a resource adapter)
a. Container Managed Sign On
In this method the resource credentials are defined in the resource adapter deployment descriptor and the application server uses those credentials to connect to EIS
b. Component Managed Sign On
In this method the application provides the required security credentials each time a connection is acquired from the resource adapter.
Security Management Interfaces to Implement
GenericCredential -Provides methods to access the security credentials of the user
EIS specific Contracts
The resource adapter communicates with the EIS using the EIS specific protocol. The J2EE Connector does not specify a protocol or an interface between a resource adapter and EIS. The adapter can use CORBA, SOAP, XML and RMI etc. as supported by EIS to access it. The resource adapter also has to handle marshalling and un-marshalling between EIS and Java Data Types.
Application Component Contracts
Application uses the client API to access the EIS. A resource adapter can either implement the Common Client Interface (CCI) or it can implement an API specific to EIS or itself.
The CCI interfaces are divided into four sections:
a. Connection Interfaces
API encapsulates interfaces for establishing a connection to an EIS
b. Interaction Interfaces
API encapsulates interfaces for sending command or queries to EIS
c. Record / ResultSet Interfaces
API encapsulates interfaces to retrieve command or query results as returned from EIS
d. Meta Data Interfaces
API encapsulates interfaces to query EIS's metadata.
Packing Resource Adapter
The packing of resource adapter includes packing the resource adapter implementation classes, client API implementation classes, dependent external libraries (optional) and a resource adapter deployment descriptor into Resource Archive (RAR) file using the Java Archive (JAR) format. The way to deploy of the .rar file depends on application server.
Example: The resources adapter adapter.rar might include the following files:
META-INF/ra.xml - Deployment Descriptor
AdapterImpl.jar - Adapter Implementation
ClientAPI.jar - Client API Implementation
DependentAPI.jar - Dependent API
The resource adapter includes an XML deployment descriptor file. The application server relies uses this information to properly deploy and interact with the resource adapter. The deployment descriptor contains information about:
a. General Information about Resource Adapter
b. Interface and Implementation Classes
c. Transaction support level
d. Authentication Information
e. Configuration Properties
Sample ra.xml
Deploying Resource Adapter
The resource adapter can be deployed to the WebLogic Server via the Weblogic Server Administration Console.
Step 0:
Launch and Sign in into Weblogic Sever Console
Expand the Domain Leaflets where you want to deploy the adapter.
Expand the Deployment Leaf under that Domain
Click on the Connector Leaf and the deployment wizard appears on the right frame.
Click on Configure New Connector component to launch the wizard.
Step 1:
Manually Copy or Upload the .rar file via console to an appropriate directory. Generally all these application go under directory $domainHome/applications
Step 2:
Select the .rar file which was uploaded or copied in Step1 that you would like to configure and deploy
Step 3:
Select the Servers to which the connector has to be deployed
Step 4:
Give the name for the application connector
Step 5:
Click on Configure and Deploy button to start the process.
If there is some problem with the deployment, the Weblogic Server throws the exception, which can be analyzed and fixed and finally the above steps can be repeated again for deployment.
If there are no errors, Weblogic Server gives confirmation about proper deployment of the connector.
Sample Code
This sample code describes Application Component code to Connection Lookup, creating Interaction and getting results using the CCI Interface.
// connection and interaction
javax.resource.cci.Connection con = null;
AdapterInteraction intr = null;
String exception = null;
String min = null;
// retrieve initial context
InitialContext ctx = new InitialContext();
__log.debug("Retrieve the Initial Context");
// get the connection factory
Object obj = ctx.lookup(IJNDINames.ADAPTER_CONNECTION_FACTORY);
__log.debug("Lookup Connection Factory JNDI...");
//type cast
AdapterConnectionFactory fact = (AdapterConnectionFactory)obj;
__log.debug("Object type casted into Connection Factory...");
//create adapter connection spec
AdapterConnectionSpec spec = new AdapterConnectionSpec();
spec.setUser("adapter-username ");
spec.setUser("adapter-password ");
// get the adapter connection
Object objConn = fact.getConnection(spec);
// type cast
__log.debug("Type cast object into cci connection");
con = (javax.resource.cci.Connection)objConn;
//create the interaction
__log.debug("Create a new Interaction from the connection");
intr = (AdapterInteraction)con.createInteraction();
// create interaction spec
__log.debug("Create a new Interaction Spec");
AdapterInteractionSpec specInt = new AdapterInteractionSpec();
specInt.setServiceType(ISAInteractionSpec.SERVICE_TYPE);
// create input record
__log.debug("Create a new ISA Record");
ISARecord recIn = new ISARecord();
recIn.setRecordName(name);
recIn.setParameter(param);
// execute the interaction
__log.debug("Execute the Interaction Service");
AdapterRecord recOut = (AdapterRecord)intr.execute(specInt,recIn);
__log.debug("Retrieved the ISA Record trying to get min");
// get results
param = recOut.getParameter();
Conclusion
JCA connector provides portable solutions for system integration with EIS that can be seamlessly plugged into the BEA application server providing transactional, security and connection management features with ease deployment and maintenance.
相关推荐
IBM Thread and Monitor Dump Analyzer for Java(简称 jca)。它可以识别Java线程中的挂起,死锁,资源竞争,和瓶颈。 使用方法: java -Xmx1000m -jar jca456.jar
IBM Thread and Monitor Dump Analyzer for Java(简称 jca)。它可以识别Java线程中的挂起,死锁,资源竞争,和瓶颈。 使用方法: java -Xmx1000m -jar jca456.jar
1. **核心概念**:理解WebLogic Server的基础概念至关重要,如域(Domain)、集群(Cluster)、服务器(Server)、部署(Deployment)等。这些概念构成了WebLogic Server的基本架构,用于管理和运行Java EE应用程序...
标准版还支持热部署、热修改(FastSwap)功能,即无需重新部署即可更新Java类,以及可选的服务启动,允许在不启动EJB、JMS、JCA等组件的情况下启动Web应用容器。轻量级安装程序也使得下载和安装过程更加快速,同时...
JCA练习 JCA练习 JCA练习 JCA练习 JCA练习
这包括了WebLogic Server的编程模型,如WebLogic Server的生命周期管理、部署API、JNDI(Java Naming and Directory Interface)和JCA(Java Connector Architecture)等。开发者在编写自定义插件、部署工具或集成...
Java Core Analysis (JCA) 工具是Java开发者在排查性能问题、监控应用程序或诊断线程问题时的重要辅助工具。这个名为"jca分析工具.zip"的压缩包包含了一个名为"jca433.jar"的文件,这很可能是JCA工具的一个版本,...
在WebLogic调用Tuxedo的场景下,通常会使用WebLogic的Web Services或者JCA(Java Connector Architecture)来实现。以下是具体步骤: 1. **配置WebLogic Tuxedo连接器(WTC)**: WebLogic提供了WebLogic Tuxedo ...
Java Comprehensive Application (JCA) 是Java平台上的一个关键组件,主要用于在Java应用程序中集成企业级服务,例如消息传递、数据库连接等。标题提到的“JCA433及JCA463”可能是两个版本号,暗示这可能是一个用于...
- **JCA(Java Connector Architecture)**:通过JCA适配器,WebLogic可以连接多种企业信息系统,如ERP、CRM等。 总结,WebLogic作为一款强大的Java EE应用服务器,集成了多种服务和功能,能有效地支持复杂的企业...
J2EE连接器架构(JCA)管理涉及配置连接器,使WebLogic Server能与不同企业信息系统集成,如ERP、CRM系统。 【管理WebLogic服务器许可证】 许可证管理涉及跟踪和更新BEA提供的产品许可证,确保合规使用。 ...
《IBM的JCA433.jar:深入剖析Java内存与性能优化》 在Java应用程序的运行过程中,内存管理和性能优化是至关重要的环节。IBM推出的JCA433.jar工具,正是针对这一需求的专业分析工具,它能有效地帮助开发者理解和解决...
1. **应用服务器核心**:WebLogic Server 8.1支持J2EE 1.4标准,包括EJB(Enterprise JavaBeans)、Servlets、JSP(JavaServer Pages)、JMS(Java Message Service)和JCA(Java Connector Architecture)等组件。...
在"jca-分析javacore和dump.zip"这个压缩包中,包含了一个名为"jca457.jar"的JCA工具和一个"执行步骤.txt"的文本文件,后者应该是指导如何使用该工具的说明。 **Java Core (javacore) 分析** Java Core,通常简称为...
8. **JMS和JCA**:通过JMS,WebLogic Server实现了消息传递和队列功能,而JCA(Java Connector Architecture)则允许与不同企业信息系统的集成。 9. **性能优化**:包括连接池、线程池、缓存策略和JVM调优等,有助...
- **JCA适配器**:Java Connector Architecture(JCA)允许WebLogic与不同系统的集成,如ERP、CRM系统。 - **WebLogic与Oracle融合中间件的整合**:作为Oracle产品的一部分,WebLogic能无缝集成其他Oracle中间件...
windchill JCA介绍 Windchill JCA 是一种基于 Java 的组件架构,旨在提供一种灵活、可扩展、可重用的组件库,以便简化 UI 设计和客户端开发过程。下面是 Windchill JCA 的主要知识点: 1. Framework 简化和自定义...
WebLogic Server提供了一个扩展的JNDI(Java Naming and Directory Interface)实现,用于查找和绑定资源。`InitialContext`是JNDI的核心接口,用于初始化上下文。`NameClassPair`和`Binding`类则分别表示JNDI名称和...
JCA467.rar中的"JCA.jar"可能是一个包含JCA组件的库,可能用于连接到特定的EIS系统,或者提供与JVM Dump分析相关的辅助工具。 对于JVM Dump的分析,通常我们会用到一些专门的工具,例如IBM的JConsole、VisualVM、...
这个JAR文件包含了服务器的启动类、EJB容器、JMS服务、JNDI服务、事务管理器以及与JDBC和JCA相关的类。开发者在编写与WebLogic Server交互的Java代码时,通常需要这个JAR作为编译时和运行时的依赖。 2. **wlclient....