JavaEE Connector Architecture - difference between system contracts and common client interface

StackOverflow https://stackoverflow.com/questions/17031959

  •  31-05-2022
  •  | 
  •  

سؤال

i need to create a slideshare to introduce JCA in an easy way. right now i'm trying to understand the whole thing but i'm still stuck in some places. I'm reading an IBM tutorial and in its example code it doesnt implement the transaction and security contracts but instead it uses an Interaction, an InteractionSpec, a RecordFactory, and IndexedRecords interface/classes (Thats CCI i suppose).

well in a share i found they stated that the contracts from JCA v1 specification need to be implemented and in this example only the "connection management contract" is being used if i understand it right.

(ConnectionMetaData, ConnectionFactory, Connection) or (ManagedConnectionFactory, ManagedConnection, ManagedConnectionMetaData) <- Whats the difference between those and are the interfaces prefixed with "Managed" the so called "Managed Connection Contract"?

Also i'm not quite sure yet but is the CCI only used for the creation of the Resource Adapter? Or can i use it as a "framework" inside my application-server to communicate with the resource adapter. In the Bean example they use a JNDI lookup to get an instance of the ConnectionFactory and use the overloaded methods of the extended CCI classes.

I understand what the contracts "do" but when do i use system contracts and when do i use CCI. I'm not getting the purpose of it.

Is the CCI some sort of "API methods" inside my resource adapter, i can then use in my application-server implementation?

The first look of JCA is so complex.

How would i communicate with a Resource Adapter inside a JBoss, Tomcat setting for instance.

هل كانت مفيدة؟

المحلول

Yes, JCA is quite a complicated machinery. The objects that are manipulated by the client (i.e. the EJB, Servlet) are not the internal ones in the JCA adaptor.

From what I recall, one of the reason for this "split" is that connection pooling is managed by the applicaton server. Obtaining connections is thus an interaction between the client, the application server and the internals of the resource adaptor. I haven't been using JCA since long time, so I don't remember sharply the details. However, I had dumped down in a blog post my understanding of JCA few years ago, maybe it will help you.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top