Re: Connection class and ManagedConnection implementations
Timothy Potter <[email protected]> Sun, 8 Feb 2004 11:36:23 -0700
| Newsgroups | gmane.comp.java.sun.connector |
|---|---|
| Message-ID | <[email protected]> |
Hi Mete, Please download my open source connector kit at www.connectorWorks.org for examples and a framework for building a connector. Answers to your questions inlined below: On Feb 5, 2004, at 5:03 AM, Mete Kural wrote: > Hello, > > I have a question. I want to use the CCI to interface with > applications. I'm trying to figure out what code to write in the > Connection and ManagedConnection implementations. As I understand > ManagedConnection is the physical connection. So what should I put in > the Connection class then? > [tjp] >> The CCI Connection encapsulates what I call the SPIBridge -- resources that help bridge the CCI back to the SPI. Here's how it works: >> Lookup CCI ConnectionFactory from JNDI >> Use CCI ConnectionFactory to create Connection >> Use CCI Connection to instantiate Interaction >> Execute Interaction So, in this scenario, the Connection must have some "bridge" back to the SPI resources that the Interaction can use to execute an EIS function. The specifics of the SPI bridge are entirely up to you. In my org.connectorworks.resource.cci.xml package, I have a DefaultConnection class that uses an SPIBridge interface as an example of this concept. > Is this a good way to implement a JCA resource adapter: > > In the ManagedConnection implementation: > - write one method for each EIS function that makes requests to the > EIS system directly > > In the Connection implementation: > - write one method for each EIS function with the same names as the > methods in the ManagedConnection class with each method simply > wrapping a call to the method with the same name in the > ManagedConnection class (for the ManagedConnection instance that is > associated with this Connection instance). > > In the Interaction implementation: > - in the execute method, based on the "FunctionName" attribute call > the appropriate method relating to that EIS function in the Connection > class associated with this Interaction instance. [tjp] >> If your EIS interface is very simple and you are only executing a small number of EIS functions, then this seems appropriate. It might be clearer if "write one method for each EIS function with the same names as the methods in the ManagedConnection class " was in the Interaction implementation vs. the Connection implementation. Also keep in mind that the Java 2 Connector Architecture (J2C) uses an InteractionSpec instance to encapsulate information about a specific function. > > I really appreciate your help. > > Thanks much, > Mete > > ======================================================================= > ==== > To unsubscribe, send email to [email protected] and include in the > body > of the message "signoff CONNECTOR-INTEREST". For general help, send > email to > [email protected] and include in the body of the message "help". > > =========================================================================== To unsubscribe, send email to [email protected] and include in the body of the message "signoff CONNECTOR-INTEREST". For general help, send email to [email protected] and include in the body of the message "help".