12.11.2014 Views

web server - Borland Technical Publications

web server - Borland Technical Publications

web server - Borland Technical Publications

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Other Considerations<br />

}<br />

}<br />

{<br />

cf = new GoodConnectionFactory( refMcf, refCm );<br />

}<br />

else<br />

{<br />

cf = new GoodConnectionFactory( refMcf );<br />

}<br />

return cf;<br />

}<br />

return null;<br />

Update the classes in the ra.xml standard deployment descriptor file. For example,<br />

before extending the implementation, the ra.xml may look something like this:<br />

com.shme.shmeAdapter.<br />

LocalTxManagedConnectionFactory<br />

javax.sql.DataSource<br />

com.shme.shmeAdapter.BadConnnectionFactory<br />

java.sql.Connection<br />

com.shme.Connection<br />

After extending the interfaces, the ra.xml may look something like this:<br />

com.shme.shmeAdapter.<br />

LocalTxManagedConnectionFactory <br />

javax.sql.DataSource<br />

com.shme.shmeAdapter.GoodConnectionFactory<br />

java.sql.Connection<br />

com.shme.shmeAdapter.Connection<br />

As this illustrates, this conversion only impacts the connection factory. No other<br />

Resource Adapter classes are affected by this conversion.<br />

Compile the Java code for the extended implementation (and any helper classes) into<br />

class files.<br />

Package these into the Resource Adapter's Java Archive (.jar) file.<br />

Update the Resource Adapter Archive (.rar) file with this extended .jar.<br />

Deploy the Resource Adapter Archive, or include it in an Enterprise Application Archive<br />

(.ear) file to be deployed as part of a J2EE application, to VisiConnect running<br />

standalone or as a Partition service in the <strong>Borland</strong> Enterprise Server.<br />

You've now converted a badly behaving Resource Adapter into a well behaving one.<br />

Sometimes the design of a Resource Adapter makes it impossible to extend the<br />

existing API implementation. In such cases you need to re-implement the offending<br />

class or classes, and set the elements in ra.xml to reference the re-implementation(s).<br />

Or better yet, choose another Resource Adapter, which is compliant with the<br />

Connectors specification to work with.<br />

282 BES Developer’s Guide

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!