users@glassfish.java.net

Re: Internal processes in EJB

From: <glassfish_at_javadesktop.org>
Date: Mon, 17 Nov 2008 03:49:19 PST

A couple of articles:

http://www.javaworld.com/javaworld/jw-06-2005/jw-0606-jca.html
http://www.theserverside.com/tt/articles/article.tss?l=J2EE1_4
https://www6.software.ibm.com/developerworks/education/j-jca/j-jca-pdf.pdf

Book
J2EE Connector Architecture and Enterprise Application Integration

Can you explain a little more about what you are trying to do and maybe I can help a little more. Your initial question indicated that you wanted to periodically query a device and update a database. Querying the device can be done by having threads (WorkItem) in the adapter and updating the database can be done by invoking an inbound endpoint which will implemented by a MDB which can then update the database. An adapter is also a good idea if you are going to use a communications protocol such as TCP or UDP to communicate to your device.

For example, I have written an adapter that communicates with our network equipment. It receives test measurement updates using UDP and then invokes an endpoint with the test measurement data, which invokes an MDB that stores the information in a database.

One thing about an adapter. On an outbound connection call, (think something like using a database connection), the adapter has available the environment of the calling component. That is, it can access SSB, JNDI, etc that the calling client component has. Once the call is complete the adapter does not have this environment anymore. So it is not easy or apparent how to have an adapter access back into the JEE components such as SSB, etc. The key here is to invoke an endpoint and the MDB that is connected to the endpoint has all of the capabilities to interact with other JEE components, JNDI, etc.
[Message sent by forum member 'bbergquist' (bbergquist)]

http://forums.java.net/jive/thread.jspa?messageID=317039